link

PrintCSS

HTML to PDF API with Print CSS Support

Use our HTML to PDF API if you want more than just a REST Service version of the Print to PDF Browser function. With the support of the three rendering tools, WeasyPrint, PagedJS, and Vivliostyle, you can make full use of CSS Paged Media!

Available on RapidAPI!

We provide API access via RapidAPI, a widely used API Marketplace. You should also check out the Postman Collection which will help you understand how the requests to the API need to be structured.

Features

Integrations

A growing number of plugins to use the PrintCSS Cloud in your favorite software.

Magazine

A WordPress Plugin to create PDFs from your Posts and Pages using the PrintCSS Cloud for PDF generation.

Pricing Plans

If you are not sure whether the PrintCSS API is the right tool for your project, you can try it out for free on the PrintCSS Playground as the playground is already using the PrintCSS API. Select either WeasyPrint, PagedJS, or Vivliostyle as a rendering tool and try out your use cases.

View the pricing plans on RapidAPI.

Support

api@printcss.net

Frequently asked questions

What is the difference between PrintCSS Cloud and other HTML to PDF APIs?

Other HTML to PDF APIs usually use a headless Chromium (Puppeteer) with minimal CSS Paged Media support. Most of them support the @page rule and nothing else.

Can I influence the version of the rendering tool?

No. You will always get the latest stable version of the rendering tool you choose in your API request.

How do I embed images?

There are two ways to include your images in the PDF either you have the images available via a public URL or provide a base64 encoded ZIP file within the requests body. The ZIP file is the preferred way as you do not need to provide your assets elsewhere.

Is my data secure? How long are you storing my data?

The data transferred via the API does not get stored but is processed at the time of the request. The data will be removed as soon as the PDF has been delivered.

Why would I use your API instead of installing the tools myself?

You can, of course, use any of these rendering tools on your servers. However, installation and maintenance of such applications can be time and cost-consuming. PrintCSS API helps save efforts and costs through its end-to-end functionality, which comes packaged in economically priced packages that suit your needs.

Are you available for template creation?

Unfortunately, we do not provide that service at the moment. However, please post your requests and we will try to accommodate them.

Articles

  1. Can I make an asynchronous request?

    | azettl

    Yes, asynchronous requests are straightforward! All you need to do is set sync to false in the requests body JSON. Here is an example of how you can do this:

  2. I want to render the same HTML and CSS with different data. Can I do that?

    | azettl

    Yes! We support that via the templating engine Twig and an additional data key within the requests body JSON. That data key needs to contain an array of your data objects. If you have only one data object, it still needs to be in an array.

  3. Is there the possibility to add dynamic content?

    | azettl

    Yes! We support the templating engine Twig for your HTML content. So you can add some dynamic content like the date and time of the PDF rendering or reformat some content, for example, to uppercase. For the full details of Twig's possibilities, please check their documentation.

  4. How do I include Images and other Assets in my PDF?

    | azettl

    There are two ways to include your images in the PDF either you have the images available via a public URL or provide a base64 encoded ZIP file within the requests body. The ZIP file is the preferred way as you do not need to provide your assets elsewhere. We support the following filetypes for

  5. Can I use JavaScript within my Code?

    | azettl

    PagedJS and Vivliostyle both handle JavaScript just like your browser would do. Why? Because they also use a headless Chromium in the background but have a layer on top to support the modern CSS Paged Media features.

  6. How do I change the rendering tool for my request?

    | azettl

    The PrintCSS Cloud API offers the three rendering tools WeasyPrint (default), PagedJS, and Vivliostyle. If you want to change the rendering tool for your REST request, all you need to do is provide the renderer's name within the options section of the requests JSON.

  7. How to create a PDF from my HTML and CSS Code?

    | azettl

    In this article, we describe how to create a PDF from your HTML and CSS code. To create a PDF from your HTML, you need to pass both HTML and CSS code in a JSON structure as the body of the POST request to our API. The JSON structure you need to send should look like the following: