URL to PDF API
SnapAPI's PDF endpoint converts any public URL to a PDF document using headless Chromium, producing pixel-perfect PDFs that accurately represent the page's print CSS styling, embedded fonts, and JavaScript-rendered content. Unlike simple HTML-to-PDF converters that process static HTML strings, SnapAPI loads the target URL in a full browser context that executes JavaScript, loads all CSS stylesheets and web fonts, and waits for dynamic content to render before capturing the PDF. The resulting PDF accurately represents the page as a browser user sees it, including content rendered by JavaScript frameworks like React, Vue, and Angular that static HTML converters cannot process. Call the PDF endpoint with the target URL and receive a binary PDF document in the response, ready to store in S3, attach to an email, or stream directly to a browser download.
PDF API for Invoice and Report Generation
SaaS applications generating customer invoices, subscription receipts, and usage reports use SnapAPI's PDF endpoint to convert HTML invoice templates rendered at a server-side URL into downloadable PDF documents. Define an invoice template page in your web application that populates with the specific invoice data when the customer's invoice URL is loaded, then call the SnapAPI PDF endpoint with that URL to capture the rendered invoice as a PDF. This approach uses your existing HTML and CSS invoice design without requiring a separate PDF generation library or template system — the same HTML template that renders in the browser for preview renders as the PDF via SnapAPI. For applications generating high volumes of invoices, implement a background job queue that processes PDF generation requests asynchronously, calling SnapAPI for each invoice URL and storing the resulting PDF in S3 with the customer ID and invoice number encoded in the object key for later retrieval.
PDF API for Document Archiving
Document archiving workflows use SnapAPI's PDF endpoint to convert web-based documents, reports, and contracts to PDF for long-term storage and offline distribution. Web applications that create documents in HTML format -- meeting notes, project specifications, compliance reports, and policy documents -- use SnapAPI to export each document as a PDF at key milestones: when a document is finalized, approved, or distributed to external stakeholders who need a portable offline copy. The PDF archive preserves the document's visual appearance as it existed at the time of export, regardless of subsequent changes to the web application's styling or the document's content, creating a reliable historical record of the document state at each archival point. For legal and compliance use cases that require document retention in a standardized format, PDF export via SnapAPI produces ISO 32000-compliant PDF files that are accepted by document management systems, court systems, and regulatory filing platforms.
PDF API for Data Export and Reporting
Business intelligence and analytics applications that display data visualizations in the browser use SnapAPI's PDF endpoint to export dashboard views and charts as PDF reports for sharing with stakeholders who need offline access to the data. Dashboard export workflows that previously required users to manually print-to-PDF from the browser -- a process that produces inconsistent results depending on the user's browser and system settings -- can be replaced with a server-side PDF generation step that calls SnapAPI with the dashboard URL, producing consistent, correctly-formatted PDFs that honor the dashboard's print CSS styling. For multi-page reports that combine data visualizations, tables, and text commentary across many pages, design the report as a single long HTML page with print CSS that controls page breaks, header and footer content, and column layout, then call SnapAPI's PDF endpoint to convert the complete report HTML to a properly paginated PDF in a single API call.
PDF API Technical Reference
SnapAPI's PDF endpoint accepts the same URL parameter as the screenshot endpoint and returns a binary PDF document with the Content-Type application/pdf header. Optional parameters control PDF output dimensions: the format parameter accepts standard page sizes including A4, A3, Letter, and Legal, with A4 and Letter being the most commonly used for business documents. The landscape parameter converts the output to landscape orientation for wide data tables and dashboard exports that display better in horizontal format. The margin parameter controls the page margins in the PDF, with sensible defaults appropriate for most business document use cases. Set the waitFor parameter to a CSS selector or a duration in milliseconds to delay PDF capture until a specific element is visible or dynamic content has finished loading, ensuring that JavaScript-rendered charts and data visualizations are fully loaded before the PDF is captured. The PDF endpoint supports the same authentication mechanism as the screenshot endpoint -- the API key as a Bearer token in the Authorization header or as an access_key query parameter.