简体   繁体   中英

wkhtmltopdf and pdfkit returning a blank pdf from url

I'm trying to create a pdf for easy reference of jobs on google careers however when I try to create a PDF using wkhtmltopdf I'm getting a blank page.

I believe this has something to do with the html of the page itself? When I try to inspect the page source the html code is very short. There's also a few javascript links.

The URL I'm trying is this one

And here's the code I'm using:

pdfkit.from_url("https://careers.google.com/jobs/results/125555613246595782-partner-engineer-google-cloud/", 'test.pdf',
           options={'--javascript-delay': 5000})

Using wkhtmltopdf like this also returns a blank pdf:

wkhtmltopdf https://careers.google.com/jobs/results/125555613246595782-partner-engineer-google-cloud/ test.pdf

Google used client-side rendering for this page.
This is an old link, but maybe it will be useful to you https://github.com/devongovett/node-wkhtmltopdf/issues/70

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM