Hi,I am using headless chromium on Windows 10 (Version 62.0.3166.0 (Developer Build) (64-bit)) to print a web application report running on Tomcat/Java server and angular 2 client into a PDF file (product in development)If I'm using this:chrome --headless --disable-gpu --print-to-pdf=my.pdf https://angular.ioI get a the PDF result just fine.But when running locally to the Tomcat/Java server:chrome --headless --disable-gpu --print-to-pdf=my.pdf http://localhost/report/1I get an empty PDF file (no content).My guess is that the specific report page takes longer to render, as it has to make few REST calls to the server to build the report.
My question: is there any way to add a delay in Chromium before printing to PDF?
I also tried to run nodeJS wrapper code such as: simple-headless-chrome, but it uses Chrome and not Chromium, so it's not good for me.
Any idea would be greatly welcome!ThxOfer
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/eefea84d-f2ce-484d-b7b7-ebca1ecce83c%40chromium.org.
On 27 July 2017 at 06:46, <ofer...@gmail.com> wrote:Hi,I am using headless chromium on Windows 10 (Version 62.0.3166.0 (Developer Build) (64-bit)) to print a web application report running on Tomcat/Java server and angular 2 client into a PDF file (product in development)If I'm using this:chrome --headless --disable-gpu --print-to-pdf=my.pdf https://angular.ioI get a the PDF result just fine.But when running locally to the Tomcat/Java server:chrome --headless --disable-gpu --print-to-pdf=my.pdf http://localhost/report/1I get an empty PDF file (no content).My guess is that the specific report page takes longer to render, as it has to make few REST calls to the server to build the report.Are you sure a delay would help? The pdf isn't printed until the Page.loadEventFired is sent. Could the problem be something else?My question: is there any way to add a delay in Chromium before printing to PDF?Generally we don't want to add too many command line switches, particularly when there's overlap with what can be done via devtools api.I also tried to run nodeJS wrapper code such as: simple-headless-chrome, but it uses Chrome and not Chromium, so it's not good for me.Why would that be a problem? Chrome supports --headless.
Any idea would be greatly welcome!ThxOfer
--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/8a7a832a-aeb0-4b4a-b326-6254ea7c8121%40chromium.org.
| const browser = new HeadlessChrome({ headless: true, chrome: { chromePath: 'YOUR_CHROME_PATH' } }) |