Simplify
PDF generation

Save time and resources with our PDF generation API. Automate PDF creation with customizable templates, full HTML/CSS/JavaScript support, and a simple REST API.

Teams generating PDFs with cloudlayer.io

Blackbaud Qonto Chopard Snappy Kraken Transport Pro Reviewshake Hello Travel Osum Food Market Hub Dayy Paper Leaf Zipmi

Three ways to generate PDFs

PDF Templates

Use our gallery of pre-built templates or create custom templates using HTML and Nunjucks templating syntax. Pass JSON data to populate your templates with dynamic content — names, dates, totals, images, and more.

Browse PDF Templates

HTML to PDF

Send raw HTML to the API and receive a pixel-perfect PDF. cloudlayer.io renders your HTML using headless Chrome, supporting full JavaScript execution, CSS frameworks like Bootstrap and Tailwind, custom fonts, and complex layouts.

HTML to PDF Docs

URL to PDF

Capture any publicly accessible URL as a PDF. cloudlayer.io navigates to the page, waits for full rendering (including JavaScript), and generates a pixel-perfect PDF. Supports session cookies and basic authentication for protected pages.

URL to PDF Docs

Pixel-perfect PDFs from any HTML

cloudlayer.io renders PDFs using a real browser engine, so every CSS rule, web font, and JavaScript animation works exactly as it does in a browser. Your PDFs match your designs down to the last pixel.

Choose from standard page sizes like A4, Letter, and Legal, or define custom dimensions for any format. Set precise margins, add repeating headers and footers with automatic page numbers, and use print media queries to fine-tune your print layout.

@page CSS rules give you granular control over page breaks, orphan/widow handling, and per-page margins. Long tables paginate automatically with repeating headers, and CSS break-before / break-after properties let you force page breaks exactly where you need them.

Page Numbers & Headers

Repeating headers and footers with dynamic page numbers, dates, and document titles on every page.

Print CSS Support

Full @media print support — hide navigation, adjust colors, and optimize layouts specifically for PDF output.

Automatic Page Breaks

Tables, lists, and content blocks paginate naturally. Use CSS break properties for explicit control over where pages split.

Custom Page Sizes

A4, Letter, Legal, Tabloid, or any custom width and height. Set orientation to portrait or landscape per document.

PDF template workflows

Invoice & Receipt Templates

Use Nunjucks for loops to iterate over line items, apply currency formatting filters, and conditionally show payment terms, tax breakdowns, or discount lines. Tables that exceed a single page automatically continue with repeating column headers, so multi-page invoices render cleanly without manual page-break logic.

Report & Certificate Templates

Embed charts rendered by JavaScript libraries like ApexCharts or Chart.js directly in your templates. Use dynamic headers that change per section, generate cover pages with conditional branding, and build a table of contents with automatic page references. Every element renders faithfully in the final PDF.

Deliver PDFs however you need

Every PDF generation request can return results in multiple formats. Choose the delivery method that fits your architecture.

  • Inline binary — stream the raw PDF bytes directly in the HTTP response for server-side serving or immediate download
  • Base64 encoded — receive the PDF as a base64 string, ready to embed in emails or store in a database field
  • CDN URL — get a shareable download link hosted on our global CDN with configurable expiration
  • Webhook delivery — fire-and-forget for async batch jobs; we POST the result to your endpoint when the PDF is ready
  • Direct cloud forwarding — send the generated PDF straight to your S3 bucket or GCS bucket without an extra round trip

Page Layout Control

Set margins, orientation, and paper size per request. Support for A4, Letter, Legal, Tabloid, or fully custom dimensions in inches or millimeters.

PDF Merge

Combine multiple PDFs into a single document in one API call. Merge generated pages with existing files, append cover sheets, or concatenate report sections.

Async & Webhooks

Submit large or complex PDFs asynchronously. We process in the background and notify your webhook endpoint when the document is ready for download.

Headers & Footers

Add repeating headers and footers to every page with dynamic content — page numbers, document titles, dates, and custom HTML. Different first-page headers supported.

Document Metadata

Set title, author, subject, and keywords on every generated PDF. Metadata improves searchability and organization when archiving or indexing documents.

File Optimization

Compress output PDFs for smaller file sizes without sacrificing quality. Ideal for email attachments with size limits or long-term document archival.

PDF generation in your workflow

Invoice pipeline

Your CRM triggers an API call when a deal closes. cloudlayer.io generates a branded PDF invoice from your template, emails it to the customer, and saves a copy to Google Drive — all in a single automated flow.

Report automation

A scheduled job pulls your latest dashboard data and hits the API. cloudlayer.io renders charts and tables into a polished PDF report, then delivers it to your team via Slack or email on a recurring schedule.

E-commerce checkout

An order webhook fires at checkout. cloudlayer.io generates a receipt PDF with line items, totals, and shipping details, then attaches it to the confirmation email — no manual document creation needed.

<1s
Average Render
For standard PDF documents
Any Size
Page Dimensions
A4, Letter, Legal, or custom
99.9%
Uptime SLA
Enterprise-grade reliability

Start generating PDFs
in minutes

Your first PDF is free. Get your API key and render a pixel-perfect PDF from HTML in under five minutes.

No commitment. Cancel anytime.