Convert HTML to PDF
AI-generatedSummary
Generate a PDF from provided HTML content using PDFBolt API.
Inputs
- html (required) — HTML content to convert to PDF; must be provided and will be base64‑encoded automatically.
- webhook (required) — Public URL that receives the conversion result when using async mode.
- endpointType — Conversion mode: direct (PDF returned in response), sync (download URL), or async (webhook callback).
- customS3PresignedUrl — Presigned S3 URL to upload the PDF directly; optional.
- retryDelays — Comma‑separated retry delays in minutes for failed async conversions.
- additionalWebhookHeaders — Custom headers (max 10) included in the async webhook callback.
- additionalOptions — Various PDF settings such as format, width, height, margins, scale, etc.
Output shape
Binary PDF file for direct mode, otherwise a JSON response containing conversion details or usage info.
Direct endpoint returns a binary PDF; sync and async endpoints return JSON with success data; getUsage returns usage statistics. No pagination.
Examples
Example 1: Convert a simple HTML snippet to PDF using direct response.
endpointType=direct, html={...}
Example 2: Generate a PDF from a public URL and receive a temporary download link.
endpointType=sync, url=https://example.com
Example 3: Perform an asynchronous conversion and have the result posted to a webhook.
endpointType=async, webhook=https://mywebhook.com, retryDelays=5,10