Convert URL to PDF
AI-generatedSummary
Convert a public URL into a PDF file using PDFBolt, choosing response mode (direct, sync URL, or async webhook).
Inputs
- endpointType — Delivery method: Direct (PDF in response), Sync (download URL), or Async (webhook callback).
- url (required) — URL of the webpage to convert to PDF. Must be publicly accessible.
- webhook (required) — Public URL to receive the result when conversion completes in async mode.
- customS3PresignedUrl — Presigned URL for uploading the PDF directly to your own S3 bucket; otherwise PDFs are stored in PDFBolt S3 for 24 hours.
- retryDelays — Comma‑separated retry delays in minutes for failed async conversions (e.g., 1,5,15).
- additionalWebhookHeaders — Custom headers (max 10) included in the async webhook callback.
- additionalOptions — Additional PDF generation settings such as format, width, height, margins, scale, etc.
- filename — Base filename for the PDF (extension added automatically).
- timeout — Maximum wait time for the page to load, in milliseconds.
- waitUntil — Condition for when the page is ready (e.g., load, networkidle).
- waitForFunction — JavaScript function that must return true before generating the PDF.
- waitForSelector — CSS selector and state to wait for before generating the PDF.
- javaScriptEnabled — Whether to run JavaScript on the page.
- tagged — Whether to generate an accessible PDF with structural tags.
- viewportSize — Browser viewport size in pixels for responsive layouts.
- isMobile — Enable mobile device emulation.
- deviceScaleFactor — Pixel density (1‑4) for sharper rendering.
- cookies — JSON array of cookies to send with the request.
- extraHTTPHeaders — Custom HTTP headers to send with the request.
- applyExtraHTTPHeadersToAllResources — Whether to apply extra HTTP headers to all resource requests.
- httpCredentials — Basic authentication credentials for password‑protected pages.
- preferCssPageSize — Use CSS @page size instead of explicit width/height settings.
- contentDisposition — Delivery method: inline (display) or attachment (download).
- pdfStandard — PDF/X compliance level for professional printing.
- colorSpace — RGB for screens (default) or CMYK for printing.
- iccProfile — Color profile used for CMYK conversion.
- preserveBlack — Preserve pure black (#000) as 100% K ink only.
Output shape
A JSON object containing the conversion result; direct mode includes a binary PDF payload, sync mode returns a temporary download URL, async mode returns a status object (delivered via webhook).
Binary payload only for direct mode; sync returns a URL valid for 24 hours; async responses are posted to the configured webhook and may include success or error details. Errors are thrown unless continueOnFail is enabled.
Examples
Example 1: Generate a PDF instantly from a public webpage and receive it as a binary response.
Endpoint: direct; URL: https://example.com; other options left at defaults.
Example 2: Obtain a temporary download URL for the generated PDF.
Endpoint: sync; URL: https://example.com; optional filename set.
Example 3: Start an asynchronous conversion and have the result posted to a webhook.
Endpoint: async; URL: https://example.com; webhook: https://myapp.com/webhook; optionally set retryDelays.