Turn any URL or raw HTML into a polished, print-ready PDF in a single API call. Perfect for invoices, reports, e-books, and documentation — without managing a headless browser.
Everything you need to generate print-quality PDFs without maintaining browser infrastructure.
Pass a URL to capture a live webpage, or POST raw HTML for fully custom layouts — invoices, certificates, tickets — without a publicly accessible URL.
Choose from A4, A3, Letter, Legal, or Tabloid. Switch between portrait and landscape. Set margins individually — top, right, bottom, left — in millimeters.
Inject custom HTML into the page header and footer for every page — company logo, document title, page numbers, date — using Chromium's native header template support.
Rendered with @media print stylesheets applied automatically. Your page's print layout is respected exactly as designed.
All hyperlinks in the source HTML remain active in the generated PDF. Internal anchors, external URLs, and mailto links are all preserved.
Dynamic React/Vue/Angular apps are fully rendered before PDF generation. Use wait_for or delay to capture charts and tables after data loads.
Replace YOUR_API_KEY with the key from your dashboard.
# Convert URL to PDF (A4, portrait) curl -G "https://api.snapapi.pics/v1/pdf" \ --data-urlencode "url=https://github.com" \ -H "Authorization: Bearer YOUR_API_KEY" \ --output page.pdf # Convert raw HTML to PDF (invoice example) curl -X POST "https://api.snapapi.pics/v1/pdf" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"html":"<h1>Invoice #1001</h1><p>Total: $250</p>","format":"A4","margin_top":"20mm"}' \ --output invoice.pdf # Landscape with custom margins curl -G "https://api.snapapi.pics/v1/pdf" \ --data-urlencode "url=https://example.com/report" \ -d "landscape=true&margin_top=10mm&margin_bottom=10mm" \ -H "Authorization: Bearer YOUR_API_KEY" \ --output report-landscape.pdf
import SnapAPI from 'snapapi-js'; const client = new SnapAPI('YOUR_API_KEY'); // URL to PDF const pdf = await client.pdf.generate({ url: 'https://github.com', format: 'A4', landscape: false, margin_top: '15mm', margin_bottom: '15mm', }); // HTML to PDF (invoice) const invoice = await client.pdf.generateFromHTML({ html: `<!DOCTYPE html> <html><body style="font-family:sans-serif"> <h1>Invoice #1001</h1> <p>Amount due: $250.00</p> </body></html>`, format: 'A4', });
from snapapi import SnapAPI client = SnapAPI("YOUR_API_KEY") # URL to PDF pdf_bytes = client.pdf.generate( url="https://github.com", format="A4", landscape=False, margin_top="15mm", margin_bottom="15mm", ) with open("output.pdf", "wb") as f: f.write(pdf_bytes) # HTML to PDF (invoice) html = """<!DOCTYPE html> <html><body style="font-family:sans-serif"> <h1>Invoice #1001</h1> <p>Amount due: $250.00</p> </body></html>""" invoice = client.pdf.generate_from_html(html=html, format="A4")
import "github.com/Sleywill/snapapi-go" client := snapapi.New("YOUR_API_KEY") buf, err := client.PDF.Generate(snapapi.PDFOptions{ URL: "https://github.com", Format: "A4", Landscape: false, MarginTop: "15mm", MarginBottom: "15mm", }) if err != nil { panic(err) } os.WriteFile("output.pdf", buf, 0644)
$client = new SnapAPI\SnapAPI('YOUR_API_KEY'); $bytes = $client->pdf->generate([ 'url' => 'https://github.com', 'format' => 'A4', 'landscape' => false, 'margin_top' => '15mm', 'margin_bottom' => '15mm', ]); file_put_contents('output.pdf', $bytes);
All parameters sent to GET /v1/pdf (URL) or POST /v1/pdf (HTML body).
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | string | required* | URL to convert. Use POST with html body instead for raw HTML. |
| html | string | Raw HTML string (POST body). Mutually exclusive with url. | |
| format | string | A4 | Page size: A3, A4, A5, Letter, Legal, Tabloid. |
| landscape | boolean | false | Use landscape orientation instead of portrait. |
| margin_top | string | 10mm | Top margin, e.g. "15mm", "1cm", "0.5in". |
| margin_right | string | 10mm | Right margin. |
| margin_bottom | string | 10mm | Bottom margin. |
| margin_left | string | 10mm | Left margin. |
| print_background | boolean | true | Include background colors and images in the PDF. |
| delay | integer | 0 | Wait N milliseconds after load before capturing. |
| wait_for | string | CSS selector to wait for before PDF generation. |
From SaaS billing to legal archives — SnapAPI's PDF API handles the full spectrum.
Render your invoice template as HTML, POST it to the API, and return the PDF to your customer in one request. No PDF library, no font embeds, no layout nightmares.
Let users export their dashboard or analytics charts as a PDF. Screenshot a live URL with wait_for to capture charts after data finishes loading.
Convert your Markdown-generated documentation or blog posts to printable PDFs. Append a custom CSS stylesheet to control typography and page breaks.
Archive web pages as legally admissible PDFs with rendered timestamps and URLs in the footer. Full-fidelity rendering preserves layout and images exactly as they appeared.
All plans include PDF, screenshot, scraping, extraction, and video. No feature gates.