KnpSnappyBundle icon indicating copy to clipboard operation
KnpSnappyBundle copied to clipboard

PDF is generated, but message saying format is wrong.

Open seyfcom opened this issue 2 years ago • 2 comments

I don't get any error message but either the adobe reader or the browser reader are saying the PDF is in a wrong format.

I have symfony 5.4.9, knplabs/knp-snappy: 1.4.1 knplabs/knp-snappy-bundle: 1.9.0

in the dev log I got this:

`[2022-06-24T09:59:52.993177+02:00] snappy.INFO: Generate from file(s) "S:\www\symf5_GeAttCo\var\cache\dev/files/tmp\knp_snappy62b56ef8f1b0b1.74630668.html" to file "files/tmp/test_file_FP_24.06.2022.pdf". {"command":""C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --image-dpi 1200 --margin-bottom "20" --margin-left "20" --margin-right "20" --margin-top "12" --orientation "portrait" --encoding "utf-8" --enable-javascript --enable-local-file-access --footer-font-name "Arial" --footer-font-size "6" --footer-spacing "5" "S:\\www\symf5_GeAttCo\var\cache\dev/files/tmp\knp_snappy62b56ef8f1b0b1.74630668.html" "files/tmp/test_file_FP_24.06.2022.pdf"","env":null,"timeout":20} []

[2022-06-24T09:59:54.045561+02:00] snappy.INFO: File "files/tmp/test_file_FP_24.06.2022.pdf" has been successfully generated. {"command":""C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --image-dpi 1200 --margin-bottom "20" --margin-left "20" --margin-right "20" --margin-top "12" --orientation "portrait" --encoding "utf-8" --enable-javascript --enable-local-file-access --footer-font-name "Arial" --footer-font-size "6" --footer-spacing "5" "S:\\www\symf5_GeAttCo\var\cache\dev/files/tmp\knp_snappy62b56ef8f1b0b1.74630668.html" "files/tmp/test_file_FP_24.06.2022.pdf"","stdout":"","stderr":"Loading pages (1/6)\r\n[> ] 0%\r[======> ] 10%\r[======> ] 11%\r[=======> ] 13%\r[=========> ] 16%\r[==========> ] 18%\r[============> ] 20%\r[=============> ] 23%\r[===============> ] 25%\r[================> ] 28%\r[==================> ] 30%\r[===================> ] 32%\r[=====================> ] 35%\r[======================> ] 37%\r[========================> ] 40%\r[=========================> ] 43%\r[===========================> ] 45%\r[============================> ] 47%\r[==============================> ] 50%\r[============================================================] 100%\rCounting pages (2/6) \r\n[============================================================] Object 1 of 1\rResolving links (4/6) \r\n[============================================================] Object 1 of 1\rLoading headers and footers (5/6) \r\nPrinting pages (6/6)\r\n[> ] Preparing\r[============================================================] Page 1 of 1\rDone \r\n"} [] `

And it is well working with another project on the same machine but symfony 5.4.4 and same version on knp packages...

Any idea?

seyfcom avatar Jun 24 '22 08:06 seyfcom

Please anyone, any hint !! I need to find quickly where to search... I have no clue

seyfcom avatar Jun 27 '22 14:06 seyfcom

Maybe difference in version of wkhtmltopdf.exe?

It is hard for other to check this. If it works on another machine i would suggest to find the diff between them. Is the pdf size 0 bytes or what is wrong with the result pdf?

Chris53897 avatar Jul 31 '22 14:07 Chris53897

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 12 '22 14:11 stale[bot]

Hello, As already pointed out by @Chris53897 it's difficult to say with so few information. Can you provide us a repository from which we can reproduce the issue? From what I can guess the issue may reside rather on the page generation rather on the wkhtmltopdf binary.

I'm closing the issue for now, I will re-open it in when you'll provide us more information.

alexpozzi avatar May 12 '23 13:05 alexpozzi