2013-03-19 71 views
0

我使用wkhtmltopdf(通過PHP包裝)將一些html文件轉換爲pdf。總而言之,它工作得很好,但在20%的情況下,它只是在沒有任何信息的情況下崩潰。因此,在不改變輸入文件的情況下,它有時可以正常工作,有時不會。wkhtmltopdf通過轉換相同的文件隨機fales

這是輸出我得到的失敗:

Could not create PDF: 
Could not run command '/www/htdocs/example/projekte/example/test/wkhtmltopdf-amd64' --ignore-load-errors "http://www.example.de/projekte/example/test/ebene/example/lieferschein-geschirr-material/lieferschein-geschirr-material.php?PHPSESSID=250cd07e432cd69eba2aa51054577d63&testmodus=1" /tmp/tmp_WkHtmlToPdf_CkYxRt: 
Loading pages (1/5) [> ] 0% [======> ] 10% [============> ] 21% [===============> ] 25% [============================================================] 100% Resolving links (2/5) [============================================================] Page 1 of 1 Counting pages (3/5) [============================================================] Page 1 of 1 Printing pages (5/5) [> ] Preparing [=======> ] Page 1 of 8 [===============> ] Page 2 of 8 [======================> ] Page 3 of 8 [==============================> ] Page 4 of 8 [=====================================> ] Page 5 of 8 [=============================================> ] Page 6 of 8 [====================================================> ] Page 7 of 8 [============================================================] Page 8 of 8 Done 

我沒有針對任何解釋。有人可能知道這個問題,可以幫助嗎?

+0

您是否曾經同時進行過兩次或多次轉換?我們的wkhtmltopdf有一些線程問題,我不認爲它們已經消失。正如https://code.google.com/p/wkhtmltopdf/issues/detail?id=511的評論中所建議的,如果您實施了各種轉換隊列,這可能會有所幫助。如果這種情況發生時,我一個一個地轉換,我有點無知。 – Nenotlep 2013-03-21 13:33:27

+0

沒有同時轉換運行。甚至通過單一訪問轉換一個幾乎空白的頁面。但無論如何感謝提示! 我仍然不知道爲什麼會發生這種情況,但這是我使用的PHP-Wrapper的一個bug(http://mikehaertl.github.com/phpwkhtmltopdf/)。我切換到http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp上提供的替代版本,它的工作原理已知。 – 2013-03-22 16:03:57

回答

0

正如我所看到的,你把錯誤的o/p文件。使用它作爲/tmp/tmp_WkHtmlToPdf_CkYxRt.pdf而不是/tmp/tmp_WkHtmlToPdf_CkYxRt,即您在調用類函數時遇到了一些問題。