Skip to content

wkhtmltopdf as a Service

PdfBroker.io wraps the wkhtmltopdf tool as a cloud-based API, enabling PDF generation from HTML without requiring local installation. Supports JavaScript rendering with configurable delays.

Endpoint

POST https://api.pdfbroker.io/api/pdf/wkhtmltopdf

URL-Based Generation

Generate a PDF from an existing web page:

{
    "url": "https://www.pdfbroker.io",
    "wkHtmlToPdfArguments": {
        "viewport-size": "1280x1024",
        "grayscale": "",
        "javascript-delay": "500"
    }
}

JavaScript Delay

The javascript-delay parameter specifies milliseconds to wait for JavaScript execution to complete before PDF generation. Useful for single-page applications and client-side rendered content.

Inline HTML Generation

Generate a PDF from inline HTML with resource objects:

{
    "url": null,
    "htmlBase64String": "PCFET0NUWVBFIGh0bWw...",
    "wkHtmlToPdfArguments": null,
    "resources": {
        "image-name.svg": "PHN2ZyBpZD0i..."
    }
}

Blocked Parameters

For security and operational reasons, these arguments are ignored:

  • manpage, help, H, h, extended-help
  • readme, license, version, V
  • debug-javascript, no-debug-javascript
  • read-args-from-stdin, htmldoc

All arguments not listed above are passed through to wkhtmltopdf. See the wkhtmltopdf manual for comprehensive options, and the Swagger documentation for the complete API specification.

See It in Action

Try wkhtmltopdf with our HTML Ticket Demo. Not sure which engine to use? Read our WeasyPrint vs wkhtmltopdf comparison.