Skip to content

PDF Generation

Try it live: HTML to PDF Editor | URL to PDF

Send HTML content and receive a PDF file:

Terminal window
curl -X POST https://api.orim.io/pdf/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>My Document</h1><p>Content here...</p>"}' \
-o document.pdf

Convert any public webpage to PDF:

Terminal window
curl -X POST https://api.orim.io/pdf/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
-o webpage.pdf

Supported formats: A4 (default), Letter, Legal, Tabloid, or custom dimensions.

{
"html": "<h1>Invoice</h1>",
"format": "Letter"
}
{
"html": "<h1>Custom Size</h1>",
"width": "8.5in",
"height": "11in"
}

Control margins with marginTop, marginRight, marginBottom, marginLeft:

{
"html": "<h1>With Margins</h1>",
"marginTop": "1in",
"marginBottom": "1in",
"marginLeft": "0.5in",
"marginRight": "0.5in"
}

Set landscape: true for landscape orientation:

{
"html": "<table>Wide table here...</table>",
"landscape": true
}

Every response includes useful headers:

HeaderDescription
X-Duration-MsProcessing time in milliseconds
X-Size-BytesPDF file size
X-SandboxWhether sandbox mode was used
LimitValue
HTML payload5 MB max
Viewport4096×4096 max
Timeout30 seconds
JavaScriptDisabled (security)

See Troubleshooting if you encounter issues.