devongovett / node-wkhtmltopdf

A wrapper for the wkhtmltopdf HTML to PDF converter using WebKit
604 stars 147 forks source link

PDF is missing Charts. When used Google Charts, Nivo Chart and few other charts. #130

Open chdharm opened 4 years ago

chdharm commented 4 years ago

`const wkhtmltopdf = require('wkhtmltopdf');

//On local:3000 I am running the service which returns chart based web page. const baseUrl = "http://localhost:3000/"; let fileName = "output.pdf";

wkhtmltopdf( baseUrl, { output: fileName }, function(){ console.log("Successfull") }); ` No charts are printed in PDF. What should I do. I know that if I can delay the PDF generation after page load but here in this API I have no such control.

zxlin commented 4 years ago

If the charts are running JS to be generated, they likely need time to be generated, you should see the docs on https://wkhtmltopdf.org/usage/wkhtmltopdf.txt

All options on there can be passed into this lib using camelCase