9
I have a PHP loop that does the following:
- Log in to a web page via CURL
- Capture and internal page that requires a login
- Save the HTML of the page to a local file
- Using WKHTMLTOPDF, render the page as a PDF
The issue I'm having is that every once in a while (maybe ~30% of the time), the images won't render in the PDF. If I open up one of the saved HTML files, I'll find that I need to go in and manually refresh the page for the images to show up.
Any ideas on how to pragmatically ensure the images load? Things I've tried:
sleep(n)between each and every line- Adding
--javascript-delay 30000to my WKHTMLTOPDF call to ensure it has ample time to load any images.
#1 made it considerably worse, and #2 did nothing at all.
Thanks!