Integrate PDFSpectrum rendering capabilities into your apps via HTTP API or native SDK client wrappers. Complete endpoint definitions, storage bindings, and layouts are documented below.
PDFSpectrum exposes a unified, highly optimized, multi-tenant endpoint for compiling dynamic HTML to pixel-perfect PDFs using high-performance Playwright/Chromium virtualization.
By configuring Bring Your Own Storage (BYOS) credentials in your Settings > Storage panel, PDFSpectrum securely routes rendered PDFs directly into your target bucket (S3, MinIO, Azure Blob, GCS).
s3:PutObject, s3:GetObject, and s3:DeleteObject.PDFSpectrum fires webhook events for lifecycle updates like pdf.completed and pdf.failed. All webhook payloads are signed using a SHA-256 HMAC signature inside the header X-PdfSpectrum-Signature.
Verify HMAC in Node.js:
const crypto = require('crypto');
function verifySignature(payload, signatureHeader, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = hmac.update(payload).digest('hex');
return signatureHeader === digest;
}Common rendering issues and printable CSS tips for Chrome/Playwright:
page-break-inside: avoid; on table rows, headings, and visual block containers to avoid rows cutting across margins.Pass specific customization options under the options dictionary block:
| Parameter | Type | Default | Description |
|---|---|---|---|
| format | string | “A4” | Paper format, e.g., Letter, Legal, A4, A3. |
| printBackground | boolean | true | Print background graphics, colors, and images. |
| margin | object | none | Specify page margins (top, bottom, left, right). |
| landscape | boolean | false | Paper orientation. Set true for landscape format. |
curl -X POST https://api.pdfspectrum.com/api/v1/pdf/generate \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
--output invoice_1042.pdf \
-d '{
"html": "<html><body><h1>Invoice #1042</h1><p>Amount: $120.00</p></body></html>",
"documentName": "invoice_1042",
"documentType": "Custom",
"options": {
"format": "A4",
"printBackground": true,
"margin": { "top": "20px", "bottom": "20px" }
}
}'API requests are subjected to tenant limits based on your entitlement quota plans. Unused request allocations expire at the end of the monthly billing cycle.