I'm trying to use chrome headless to print my webpage to a PDF file. The PDf file is with no data, because the headless chrome is printing it before the ajax commands finish.
Any idea on how I can get it to wait?
Here's the command I currently use:
chrome --headless http://localhost:8080/banana/key --run-all-compositor-stages-before-draw --print-to-pdf=C:\\tmp\\tmp.pdf
chrome --headless http://localhost:8080/banana/key --run-all-compositor-stages-before-draw --print-to-pdf=C:\tmp\tmp.pdf --virtual-time-budget=10000
Try this, virtual-time-budget is the parameter which can delay it.