PDF Generation
Generate production-ready PDFs with full control over margins, DPI, color modes, and page ranges
Orshot generates high-quality PDFs from your Studio templates — perfect for certificates, invoices, reports, tickets, and print-ready materials. Set response.format to pdf and use pdfOptions to control output quality and formatting.
PDFs are print ready by default. Text and shapes stay sharp at any print size, and your images keep their full original resolution. For crisp printed photos, upload high resolution images to your template; no extra settings needed.
Quick Start#
To generate a PDF, set the response.format to "pdf" in your API request:
const response = await fetch("https://api.orshot.com/v1/studio/render", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
templateId: "<YOUR_TEMPLATE_ID>",
modifications: {
recipient_name: "Jane Smith",
certificate_title: "Course Completion Certificate",
date: "March 25, 2026",
},
response: {
format: "pdf",
type: "url",
},
}),
});
const data = await response.json();
console.log(data.data.content); // PDF URLHow It Works#
- Design a template in Orshot Studio — the same template can render as an image or PDF
- Call the API with
response.format: "pdf"and any content overrides - Receive your PDF as a hosted URL or binary data
The same template that generates a PNG social post can generate a PDF document — just change the format.
API Request Structure#
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string | Yes | Your Studio template ID |
modifications | object | No | Content overrides |
response.format | string | Yes | Set to "pdf" |
response.type | string | No | "url" or "binary" |
response.scale | number | No | Scale factor for output size |
response.fileName | string | No | Custom filename (without extension) |
pdfOptions | object | No | PDF-specific settings (title, margin, DPI, color mode, page range) |
PDF Options#
Use the pdfOptions object to fine-tune your PDF output:
{
"templateId": "<YOUR_TEMPLATE_ID>",
"modifications": {
"title": "Quarterly Report"
},
"response": {
"format": "pdf",
"type": "url"
},
"pdfOptions": {
"title": "Quarterly Report Q1 2026",
"margin": "20px",
"dpi": 300,
"colorMode": "rgb",
"rangeFrom": 1,
"rangeTo": 3
}
}| Option | Type | Default | Description |
|---|---|---|---|
title | string | response.fileName | Document Title metadata, shown in browser tabs and PDF readers |
margin | string | "0px" | Margin around the PDF content (CSS value) |
dpi | number | 72 | Resolution — use 300 for print quality |
colorMode | string | "rgb" | Color mode: "rgb" for screen, "cmyk" for print |
rangeFrom | number | null | Start page (for multi-page templates) |
rangeTo | number | null | End page (for multi-page templates) |
Response#
The response structure is the same as image generation:
{
"data": {
"content": "https://storage.orshot.com/cloud/renders/pdfs/invoice-001.pdf",
"renders": 1,
"mimeType": "application/pdf"
}
}Common Use Cases#
Certificates#
const response = await fetch("https://api.orshot.com/v1/studio/render", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
templateId: "<CERTIFICATE_TEMPLATE>",
modifications: {
recipient: "Alex Johnson",
course: "Advanced JavaScript",
date: "March 25, 2026",
certificate_id: "CERT-2026-001",
},
response: {
format: "pdf",
type: "url",
fileName: "certificate-alex-johnson",
},
pdfOptions: {
dpi: 300,
},
}),
});Invoices#
await fetch("https://api.orshot.com/v1/studio/render", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
templateId: "<INVOICE_TEMPLATE>",
modifications: {
invoice_number: "INV-2026-0042",
client_name: "Acme Corp",
amount: "$2,450.00",
due_date: "April 15, 2026",
cta_button: "Pay Now",
"cta_button.href": "https://pay.example.com/inv-0042",
},
response: {
format: "pdf",
type: "url",
},
}),
});Event Tickets#
await fetch("https://api.orshot.com/v1/studio/render", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <YOUR_API_KEY>",
},
body: JSON.stringify({
templateId: "<TICKET_TEMPLATE>",
modifications: {
event_name: "Tech Conference 2026",
attendee: "Sarah Chen",
seat: "Row A, Seat 14",
qr_code:
"https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=TICKET-001",
},
response: {
format: "pdf",
type: "url",
},
}),
});Print-Ready PDFs#
For professional printing, use high DPI and CMYK color mode:
{
"response": {
"format": "pdf",
"type": "url"
},
"pdfOptions": {
"dpi": 300,
"colorMode": "cmyk",
"margin": "0px"
}
}CMYK color mode ensures accurate color reproduction when printing. Use it for business cards, flyers, and other print materials.
What's Next#
Ready to automate?
Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.
Get your API key- Image, PDF and video generation via API
- Visual editor with AI and smart layouts
- Zapier, Make, MCP and 50+ integrations
- White-label embed for your own app
- 30 free credits — no credit card required