In this post we will outline why in some cases PDFs are rendering blank or maybe only some elements, or part of elements are appearing but not everything on the page. We are going to explain why this occurs when rendering PDFs with Headless Chrome, but it would impact any browser based engine. Common causes:
Why is this happening?
You have a couple options.
If you are already an API2PDF user, you have an API key. If you are looking to generate PDFs, you can quickly grab an API key from here.
See our v2 Headless Chrome documentation here: https://app.swaggerhub.com/apis-docs/api2pdf/api2pdf/2.0.0-beta
If you are migrating from v1 api, take note that the v2 base endpoint is https://v2.api2pdf.com and chrome’s URL to PDF endpoint is https://v2.api2pdf.com/chrome/pdf/url.
Observe the advanced option in the payload called delay. This value is set to milliseconds. For example, if you wanted to wait for 1 second, you would set this value to 1000. Set this value as high as necessary to ensure all elements render into the PDF.
Here is an example usage in Python.Tags: delay render of pdf, headless chrome blank pdf rendering, headless chrome delay, headless chrome pdf not rendering
Comments are closed.