What PDF options can I control?
Title metadata, margins, DPI, color mode, outlined text, image compression and page range, all set per render.
Published ·Updated
The pdfOptions object gives you control over the quality and formatting of your PDF output. These options only apply when response.format is set to "pdf".
All Options#
{
"pdfOptions": {
"title": "Spring Sale Flyer",
"margin": "20px",
"colorMode": "rgb",
"outlineText": false,
"imageFormat": "auto",
"imageQuality": 85,
"maxImageDpi": 300
}
}Document Title#
Set the PDF's Title metadata. Browsers show it in the tab when the PDF is opened from a URL or stream, and PDF readers show it in the window title. Without it, viewers fall back to the file name or generic labels like "about:blank".
{
"pdfOptions": {
"title": "Spring Sale Flyer"
}
}If you don't set a title but pass response.fileName, the file name is used as the title automatically:
{
"response": {
"format": "pdf",
"type": "url",
"fileName": "invoice-1042"
}
}This PDF carries the title invoice-1042 even though pdfOptions.title was never set. Pass an explicit pdfOptions.title when you want the display title to differ from the file name.
Margins#
Add spacing around your PDF content. margin takes a pixel value such as "20px", or a plain number that is treated as pixels:
{
"pdfOptions": {
"margin": "20px"
}
}Useful for adding white space around the design when printing, or ensuring content doesn't get cut off at the edges.
{
"pdfOptions": {
"margin": "0px"
}
}Set to "0px" for edge-to-edge designs like posters or full-bleed prints.
Per-Side Margins#
Override individual sides with marginTop, marginBottom, marginLeft, and marginRight. Each overrides the global margin for that side, which is useful for asymmetric layouts like a footer disclaimer or a binding edge.
Use pixel values. A non-pixel unit on margin (for example "20mm" or
"1in") fails the request with a 400, so no PDF is produced. Per-side
values are not checked, so use pixel values there too.
{
"pdfOptions": {
"margin": "20px",
"marginBottom": "60px"
}
}Page Size#
With no dpi and a scale of 1, each PDF page is the size of your canvas, at 96 px per inch. A 794×1123 canvas gives an A4 page and 816×1056 gives US Letter.
The a4-document (2480×3508) and us-letter (2550×3300) size presets are 300 dpi pixel sizes for images. A PDF rendered at them comes out about 3 times larger than the paper size.
DPI (Resolution)#
Your PDFs are print ready at the default settings. Text and shapes are
vectors that stay sharp at any size, and images keep their full original
resolution. Raising dpi scales the output page dimensions up; use it when
your workflow needs a larger page, not to make prints sharper. For sharper
printed photos, upload higher resolution images.
dpi scales the PDF page. The page is multiplied by dpi / 72.
| DPI | Result |
|---|---|
72 (default) | The PDF page matches your canvas size. |
150 | The PDF page is about 2x larger. |
300 | The PDF page is about 4x larger. Use this only when a workflow needs large pixel dimensions. |
{
"pdfOptions": {
"dpi": 150
}
}Leave dpi unset when you want a real paper size such as A4 or Letter. Text and shapes stay sharp at any size. To get higher-resolution photos, use larger source images.
Color Mode#
Control the color space used in the PDF:
RGB (Default)#
{
"pdfOptions": {
"colorMode": "rgb"
}
}RGB is the standard for digital displays — monitors, phones, tablets. Use this for PDFs that will be viewed on screen.
CMYK#
{
"pdfOptions": {
"colorMode": "cmyk"
}
}CMYK is the standard for professional printing. Colors are converted to the Cyan, Magenta, Yellow, and Key (black) color space, ensuring accurate color reproduction on paper.
Use CMYK for:
- Business cards
- Brochures and flyers
- Magazine ads
- Any material sent to a print shop
Outline Text#
Some print shops reject PDFs that contain certain fonts, often with an error about unnamed or Type 3 fonts, and ask for text "converted to outlines". Set outlineText to true to do exactly that:
{
"pdfOptions": {
"colorMode": "cmyk",
"outlineText": true
}
}Every piece of text is drawn as a vector shape instead of letters in a font, so the PDF contains no fonts at all. Text looks the same and stays sharp at any zoom or print size.
| Option | Default | Description |
|---|---|---|
outlineText | false | true turns all text into vector outlines. Off by default. |
Outlined text can't be selected, copied or searched, and screen readers can't read it. Use it for files going to print, and leave it off for PDFs people read on screen.
It works with or without colorMode: "cmyk" and with imageFormat, in the same processing step. Links and the document title are kept.
On its own (without colorMode: "cmyk" or imageFormat: "jpeg"), outlining keeps every image lossless, so a photo-heavy RGB PDF can come out several times larger. Add "imageFormat": "jpeg" if file size matters.
Image Compression#
Photo-heavy PDFs can get large. The renderer stores any image it had to scale, crop, or composite as raw pixel data rather than reusing the original JPEG, so a print flyer with eight listing photos can easily run past 20 MB even when the source photos were a few hundred KB each.
Set imageFormat to "jpeg" to re-encode the embedded images:
{
"pdfOptions": {
"imageFormat": "jpeg",
"imageQuality": 85,
"maxImageDpi": 300
}
}| Option | Default | Description |
|---|---|---|
imageFormat | "auto" | "auto" leaves images untouched. "jpeg" re-encodes them. |
imageQuality | 85 | JPEG quality from 1 to 100. 85 is print quality. |
maxImageDpi | 300 | Downsamples images above this resolution. Set to 0 to re-encode without downsampling. |
On a real property flyer with eight listing photos, this took the output from 29.4 MB to 2.8 MB with no visible difference at print size. Reductions of 80 to 90% are typical for photo-heavy pages, and pages that are mostly text or vector shapes see little change.
imageQuality | Output | Saved |
|---|---|---|
95 | 6.4 MB | 77% |
85 (default) | 2.8 MB | 90% |
70 | 2.0 MB | 93% |
imageQuality and maxImageDpi only apply when imageFormat is "jpeg".
On an RGB render, compression never makes a document larger: if re-encoding
would grow the file, the original is returned instead. That safeguard does
not apply when colorMode is "cmyk", because returning the RGB original
would defeat the point of asking for CMYK. See With CMYK.
What is safe#
- Text, shapes, and other vector content is not an image, so compression never touches it.
- Transparency is preserved exactly. A transparent image is stored as colour data plus a separate alpha mask, and only the colour data is re-encoded. The mask stays lossless, so logos and cut-out images keep clean edges.
- QR codes and barcodes are re-encoded like any other colour image, but they survive it. Across every quality setting down to 60, a 33x33-module code decoded with zero incorrect modules.
Where it is a poor fit#
JPEG is built for photographs. On images that are mostly flat colour with hard edges, such as screenshots, charts, diagrams, or logos flattened into the page as a raster, it produces visible ringing around the edges even at quality 85. Templates like that gain little from compression anyway, since that kind of image already compresses well losslessly. Leave imageFormat at "auto" for them, or raise imageQuality to 95 or above.
With CMYK#
colorMode: "cmyk" already recompresses images as part of the color conversion, so CMYK output is small before you touch imageFormat. Setting imageFormat: "jpeg" alongside it swaps that automatic behavior for the exact imageQuality you asked for. At the default of 85 that is often larger than CMYK on its own, and on graphics-heavy pages it can exceed the uncompressed render. Lower imageQuality if you want CMYK output smaller.
When to leave it off#
Compression rebuilds the document, which drops the tagged-PDF structure used by screen readers. colorMode: "cmyk" does the same. If accessibility tags matter for your output, leave both off. Text stays selectable, fonts stay embedded, links keep working, and page dimensions are unchanged either way.
Multi-page PDFs do not carry tags to begin with, so there is nothing extra to lose there.
Page Ranges#
To pick pages from a multi-page template, use response.includePages. By default every page is included.
{
"response": {
"format": "pdf",
"type": "url",
"includePages": [2, 3, 4]
}
}This generates a PDF with only pages 2, 3 and 4 from your template. You are billed only for the pages you render.
Do not use pdfOptions.rangeFrom and pdfOptions.rangeTo to pick pages.
Each template page prints as exactly one PDF page, so these options cannot
select template pages. A range that starts after page 1 can make the render
fail.
Complete Example#
Generate a print-ready certificate with full options:
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: {
name: "Sarah Chen",
course: "UX Design Fundamentals",
date: "March 25, 2026",
},
response: {
format: "pdf",
type: "url",
scale: 1,
fileName: "certificate-sarah-chen",
},
pdfOptions: {
margin: "0px",
colorMode: "cmyk",
outlineText: true,
},
}),
});DPI and Scale#
dpi and response.scale control the same thing, so they do not stack. When dpi is set on a PDF render it replaces response.scale entirely, using scale = dpi / 72.
{
"response": {
"format": "pdf",
"type": "url",
"scale": 2
},
"pdfOptions": {
"dpi": 300
}
}The scale: 2 above is ignored. The render uses 300 / 72, or roughly 4.17x. To scale by an exact factor, set response.scale and leave dpi unset.
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 40+ integrations
- White-label embed for your own app
- 100 free credits a month, no credit card required