PDF Generation
Try it live: HTML to PDF Editor | URL to PDF
HTML to PDF
Section titled “HTML to PDF”Send HTML content and receive a PDF file:
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.pdfURL to PDF
Section titled “URL to PDF”Convert any public webpage to PDF:
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.pdfPage format
Section titled “Page format”Supported formats: A4 (default), Letter, Legal, Tabloid, or custom dimensions.
{ "html": "<h1>Invoice</h1>", "format": "Letter"}Custom dimensions
Section titled “Custom dimensions”{ "html": "<h1>Custom Size</h1>", "width": "8.5in", "height": "11in"}Margins
Section titled “Margins”Control margins with marginTop, marginRight, marginBottom, marginLeft:
{ "html": "<h1>With Margins</h1>", "marginTop": "1in", "marginBottom": "1in", "marginLeft": "0.5in", "marginRight": "0.5in"}Orientation
Section titled “Orientation”Set landscape: true for landscape orientation:
{ "html": "<table>Wide table here...</table>", "landscape": true}Response headers
Section titled “Response headers”Every response includes useful headers:
| Header | Description |
|---|---|
X-Duration-Ms | Processing time in milliseconds |
X-Size-Bytes | PDF file size |
X-Sandbox | Whether sandbox mode was used |
Limitations
Section titled “Limitations”| Limit | Value |
|---|---|
| HTML payload | 5 MB max |
| Viewport | 4096×4096 max |
| Timeout | 30 seconds |
| JavaScript | Disabled (security) |
See Troubleshooting if you encounter issues.