SDK methods for generating PDF documents from templates.
The client.pdf namespace provides typed methods for generating PDF documents from pre-defined templates. Currently supports offer letters and property flyers with server-side HTML-to-PDF rendering. Available in TypeScript, Python, and Go SDKs.
| SDK | Install | Namespace |
|---|---|---|
| TypeScript | npm install @caldera/platformxe-sdk | client.pdf |
| Python | pip install platformxe | client.pdf |
| Go | go get github.com/calderax/platformxe-go | client.Pdf |
Generate offer letter
Render an offer letter PDF from structured data.
const result = await client.pdf.offerLetter({
tenantName: 'Ada Okafor',
propertyAddress: '15 Admiralty Way, Lekki Phase 1, Lagos',
monthlyRent: 450000,
currency: 'NGN',
startDate: '2026-06-01',
duration: 12,
landlordName: 'Caldera Properties Ltd',
});
console.log(result.url); // Signed download URL
console.log(result.fileSize); // Size in bytes
result = client.pdf.offer_letter(
tenant_name="Ada Okafor",
property_address="15 Admiralty Way, Lekki Phase 1, Lagos",
monthly_rent=450000,
currency="NGN",
start_date="2026-06-01",
duration=12,
landlord_name="Caldera Properties Ltd",
)
result, err := client.Pdf.OfferLetter(map[string]interface{}{
"tenantName": "Ada Okafor",
"propertyAddress": "15 Admiralty Way, Lekki Phase 1, Lagos",
"monthlyRent": 450000,
"currency": "NGN",
"startDate": "2026-06-01",
"duration": 12,
"landlordName": "Caldera Properties Ltd",
})
Generate property flyer
Render a property flyer PDF for marketing or listing purposes.
const result = await client.pdf.propertyFlyer({
title: 'Luxury 3-Bedroom Apartment',
address: '15 Admiralty Way, Lekki Phase 1, Lagos',
price: 4500000,
currency: 'NGN',
bedrooms: 3,
bathrooms: 2,
features: ['Swimming pool', 'Gym', '24hr power', 'Secure parking'],
images: [
'https://storage.example.com/property/exterior.jpg',
'https://storage.example.com/property/living-room.jpg',
],
agentName: 'Bimpe Adeyemi',
agentPhone: '+2348012345678',
});
console.log(result.url);
result = client.pdf.property_flyer(
title="Luxury 3-Bedroom Apartment",
address="15 Admiralty Way, Lekki Phase 1, Lagos",
price=4500000,
currency="NGN",
bedrooms=3,
bathrooms=2,
features=["Swimming pool", "Gym", "24hr power", "Secure parking"],
images=[
"https://storage.example.com/property/exterior.jpg",
"https://storage.example.com/property/living-room.jpg",
],
agent_name="Bimpe Adeyemi",
agent_phone="+2348012345678",
)
result, err := client.Pdf.PropertyFlyer(map[string]interface{}{
"title": "Luxury 3-Bedroom Apartment",
"address": "15 Admiralty Way, Lekki Phase 1, Lagos",
"price": 4500000,
"currency": "NGN",
"bedrooms": 3,
"bathrooms": 2,
"features": []string{"Swimming pool", "Gym", "24hr power", "Secure parking"},
"images": []string{
"https://storage.example.com/property/exterior.jpg",
"https://storage.example.com/property/living-room.jpg",
},
"agentName": "Bimpe Adeyemi",
"agentPhone": "+2348012345678",
})
Processor configuration
Get processor config
const config = await client.pdf.getProcessor();
config = client.pdf.get_processor()
config, err := client.Pdf.GetProcessor()
Update processor config
Configure PDF rendering options such as page size, margins, and header/footer templates.
const updated = await client.pdf.updateProcessor({
enabled: true,
config: {
defaultPageSize: 'A4',
defaultMargins: { top: 20, right: 15, bottom: 20, left: 15 },
headerTemplate: '<div style="font-size:10px;">Caldera Properties</div>',
},
});
updated = client.pdf.update_processor(
enabled=True,
config={
"defaultPageSize": "A4",
"defaultMargins": {"top": 20, "right": 15, "bottom": 20, "left": 15},
},
)
updated, err := client.Pdf.UpdateProcessor(map[string]interface{}{
"enabled": true,
"config": map[string]interface{}{
"defaultPageSize": "A4",
"defaultMargins": map[string]interface{}{"top": 20, "right": 15, "bottom": 20, "left": 15},
},
})
Generated PDFs are stored temporarily. Download URLs are signed and expire after 1 hour. For long-term storage, download the file and upload it to your storage service or use the PlatformXe documents API.
Scopes required
| Method | Scope |
|---|---|
pdf.offerLetter() | templates:read |
pdf.propertyFlyer() | templates:read |
pdf.getProcessor() | templates:read |
pdf.updateProcessor() | templates:write |