Introduction

Generate production-ready PDFs from your templates with full control over margins, page ranges, color modes, DPI, and interactive links.

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.

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 URL

How It Works#

  1. Design a template in Orshot Studio — the same template can render as an image or PDF
  2. Call the API with response.format: "pdf" and any content overrides
  3. 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#

FieldTypeRequiredDescription
templateIdstringYesYour Studio template ID
modificationsobjectNoContent overrides
response.formatstringYesSet to "pdf"
response.typestringNo"url" or "binary"
response.scalenumberNoScale factor for output size
response.fileNamestringNoCustom filename (without extension)
pdfOptionsobjectNoPDF-specific settings (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": {
    "margin": "20px",
    "dpi": 300,
    "colorMode": "rgb",
    "rangeFrom": 1,
    "rangeTo": 3
  }
}
OptionTypeDefaultDescription
marginstring"0px"Margin around the PDF content (CSS value)
dpinumber72Resolution — use 300 for print quality
colorModestring"rgb"Color mode: "rgb" for screen, "cmyk" for print
rangeFromnumbernullStart page (for multi-page templates)
rangeTonumbernullEnd 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",
    },
  }),
});

For professional printing, use high DPI and CMYK color mode:

{
  "response": {
    "format": "pdf",
    "type": "url"
  },
  "pdfOptions": {
    "dpi": 300,
    "colorMode": "cmyk",
    "margin": "0px"
  }
}

What's Next#

All Set? Let's Start Automating

Get Your API Key →
  • Image, PDF and Video Generation via API
  • Canva like editor with AI and smart features
  • No-Code Integrations (Zapier, Make, n8n etc.)
  • Embed Orshot Studio in your app
  • Start Free. No credit card required. Cancel anytime.