PDF Generation hangs using PDFKit and wkhtmotopdf

2020-05-01 05:19发布

问题:

I'm on OSX Lion using wkhtmtopdf that came with homebrew (0.9.9) and all of the sudden I cannot generate PDFs anymore. When I tack .pdf on the end of a URL, the wkhtmltopdf process fires up, but the process never completes. I suspect it's an issue with wkhtmltopdf because the process is not completing when I run it via the cli either. When I issue the following command, I get a test.pdf file, but the process never finishes, even though it says "done".

Is there something I can do to force the process to complete?

curl google.com | wkhtmltopdf - test.pdf

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   219  100   219    0     0   1685      0 --:--:-- --:--:-- --:--:--  5475
Loading page (1/2)
Printing pages (2/2)                                               
Done

回答1:

Turns out it had nothing to do with the cli and it was actually due to Jammit running in development. Disabling Jammit fixes the PDFkit hanging issue.