Weasyprint as a service


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

This is our premium pdf service with support for css paged media and html 5. Pdf version up to 1.7 is supported and pdf types pdf/a-1b, pdf/a-2b, pdf/a-3b, pdf/a-4b and pdf/ua-1 are supported. This service requires a paid subscription. New accounts gets a 14 days trial period.

Example generating pdf from url

Example of generating pdf/ua-1 document.

     "url": "https://www.pdfbroker.io",
     "weasyPrintToPdfArguments": {
         "pdf-variant": "pdf/ua-1"       

Example generating pdf from inline markup

Example of generating pdf document using inline markup encoded as base64, and providing an image as a resource in the resources object

    "url": null,
    "htmlBase64String": "PCFET0NUWVBFIGh0bWw.... Content removed for readability.",
     "weasyPrintToPdfArguments": {
         "pdf-variant": "pdf/ua-1"       
    "resources": { "pdfbroker_logo.svg": "PHN2ZyBpZD0iTGFnZXJfMS.... Content removed for readability" } 

Ignored Weasyprint arguments

There are a few parameters to Weasyprint that is ignored by our api for security reasons or because they make no sense using when you don't have access to standard output.
The following arguments will not be passed on to Weasyprint:

  • v
  • verbose
  • version
  • d
  • debug
  • q
  • quiet
  • h
  • help
  • u
  • f
  • format

Valid Weasyprint arguments

All arguments that are not listed above will be sent on to Weasyprint. For a full list of arguments please checkout the Weasyprint documentation https://doc.courtbouillon.org/weasyprint/stable/api_reference.html#command-line-api

Open API/Swagger specification

Full specification and more examples available on our Swagger page

Checkout Swagger documentation



Let us know what you think and help us improve