How to PDF Webhooks Guide
Webhooks let SublimePDF push notifications to your server when asynchronous events complete — a PDF finishes rendering, a batch job completes, or a conversion fails. Instead of polling the API for status, your application receives an HTTP POST callback the moment results are ready, enabling real-time workflows and reducing unnecessary API calls.
Follow the step-by-step instructions below, then use the free tool directly — no registration or download required.
Open Tool →How to PDF Webhooks Guide — Step by Step
Create a webhook endpoint
Build an HTTP POST endpoint on your server (e.g., /webhooks/sublimepdf) that accepts JSON payloads. Return a 200 status quickly — process the payload asynchronously to avoid webhook timeouts.
Register the webhook in your dashboard
Go to Settings → Webhooks in the SublimePDF dashboard. Enter your endpoint URL, select which events to subscribe to (pdf.completed, pdf.failed, batch.completed), and save.
Verify webhook signatures
Each webhook request includes an X-Signature-256 header containing an HMAC-SHA256 hash of the request body using your webhook secret. Compute the hash on your end and compare to prevent accepting forged requests.
Parse the event payload
The JSON body contains: 'event' (event type), 'data' (event-specific payload with documentId, downloadUrl, metadata), and 'timestamp'. Use the documentId to match the webhook to the original generation request.
Implement retry handling
SublimePDF retries failed webhook deliveries (non-2xx responses) up to 5 times with exponential backoff over 24 hours. Make your endpoint idempotent — use the event's unique 'id' field to deduplicate in case of retries.
Pro Tips
- 💡 Use a tool like ngrok or Cloudflare Tunnel during development to expose your local server to the internet for webhook testing.
- 💡 Always verify the X-Signature-256 header in production — skipping signature verification opens your endpoint to spoofed webhook payloads.
- 💡 Return a 200 response immediately, then process the webhook payload in a background job. If your endpoint takes too long, SublimePDF will treat it as a failure and retry.
- 💡 Log every incoming webhook payload for debugging — store the raw JSON body along with headers so you can replay events if processing fails.
Privacy & Security
All processing happens directly in your browser. Your files are never uploaded to any server — they remain on your device throughout the entire process. SublimePDF uses WebAssembly technology for fast, secure, client-side processing.
Works Everywhere
This tool works on any modern browser — Chrome, Firefox, Safari, or Edge — on desktop, tablet, or mobile. No software to install. PDF is an open ISO standard supported by all major platforms.
How to PDF Webhooks Guide — FAQ
What events can I subscribe to?
How do I test webhooks during local development?
What if my server is down when a webhook fires?
Can I have multiple webhook endpoints for different events?
Related Guides
How to HTML To PDF Css Guide
CSS controls how your HTML-to-PDF output looks — page margins, fonts, and print-specific layouts. SublimePDF uses Chromium rendering, so standard CSS works plus @page rules for PDF control. Mastering print CSS lets you create pixel-perfect invoices, reports, and documents that look identical on screen and in the generated PDF.
How to HTML To PDF Fonts Guide
Typography makes or breaks PDF quality. SublimePDF's Chromium renderer supports web fonts, system fonts, and embedded fonts so your generated PDFs match your brand's typeface exactly. This guide covers loading custom fonts, handling fallbacks, and avoiding common rendering issues like missing glyphs, font substitution, and blurry text.
How to Convert HTML To PDF
Converting HTML to PDF is a core workflow for developers, marketers, and anyone who needs a permanent, printable snapshot of web content. Whether you're archiving a webpage, generating reports from a web app, saving receipts from online purchases, or creating documentation from HTML templates, PDF conversion captures the visual layout, links, and styling in a portable format.