Search code examples
wkhtmltopdf

is there way to debug or capture javascript errors in wkhtmltopdf?


The scenario is easy - I create PDFs with wkhhtmltopdf, and sometimes I struggle with things like

window.performance

not supported by this version.

So scripts are not fully executed.

Until now my way to find errors like that, was to use the very old Windows Safari browser, that helped me finding these errors.

But now I have a script error with the old wkhtmtlopdf, that does not even show in windows Safari.

I found it (or not really) with heavy and nasty script changing (comment out the half), but I would like to know if there is a way to get the correct error with wkhtmtlopdf while parsing.


Solution

  • Run wkhhtmltopdf with the command line using --debug-javascript argument.