Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

HB_BHF's avatar

Snappy cannot convert DataTable to PDF

I am using Snappy for exporting to PDF (which uses wkhtmltopdf). But with DataTables I am getting this error:


RuntimeException in AbstractGenerator.php line 336:
The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)
[> ] 0%
[======> ] 10%
[==============> ] 24%
[================> ] 27%
[=================> ] 29%
[=====================> ] 35%
[========================> ] 40%
[=========================> ] 43%
[===========================> ] 46%
[====================================> ] 60%
[===========================================> ] 72%
[=============================================> ] 75%
[==============================================> ] 78%
[================================================> ] 81%
[=================================================> ] 82%
[===================================================> ] 86%
[============================================================] 100%
Counting pages (2/6) 
[============================================================] Object 1 of 1
Resolving links (4/6) 
[============================================================] Object 1 of 1
Loading headers and footers (5/6) 
Printing pages (6/6)
[> ] Preparing
[========> ] Page 1 of 7
[================> ] Page 2 of 7
[=========================> ] Page 3 of 7
[==================================> ] Page 4 of 7
[==========================================> ] Page 5 of 7
[===================================================> ] Page 6 of 7
[============================================================] Page 7 of 7
Done 
Exit with code 1 due to network error: ProtocolInvalidOperationError
"
stdout: ""
command: /usr/local/bin/wkhtmltopdf --lowquality --dpi '100' --image-quality '100' --margin-top '0' --orientation 'portrait' --page-size 'a4' --enable-javascript --javascript-delay '10000' --no-stop-slow-scripts '/tmp/knp_snappy5892170450c9f0.06901819.html' '/tmp/knp_snappy5892170450d5c1.44857247.pdf'.

Any ideas why? I've enabled javascript for wkhtmltopdf and it exports everything fine except these DataTables... :@

0 likes
3 replies
maxbool's avatar

I am dealing with the same problem as you.

vajid's avatar

change https to http

had similar issue once after searching found one post on github about changing to http it had worked for me

maxbool's avatar

This issue is only with DataTables:

Exit with code 1 due to network error: ContentNotFoundError

RuntimeException in AbstractGenerator.php line 378: The exit status code '1' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% [=======> ] 12% [=======> ] 13% [================> ] 28% [=====================> ] 35% [========================> ] 41% [============================================================] 100% Counting pages (2/6) [============================================================] Object 1 of 1 Resolving links (4/6) [============================================================] Object 1 of 1 Loading headers and footers (5/6) Printing pages (6/6) [> ] Preparing [============================================================] Page 1 of 1 Done Exit with code 1 due to network error: ContentNotFoundError " stdout: "" command: /home/paramountin/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality --margin-bottom '10mm' --margin-left '0' --margin-right '0' --margin-top '10mm' --orientation 'landscape' --no-outline '/tmp/knp_snappy5c178ff71fcae1.46181974.html' '/tmp/knp_snappy5c178ff71fce49.45429172.pdf'.

Please or to participate in this conversation.