How to delay print to PDF

23 views
Skip to first unread message

עופר בר

unread,
Jul 27, 2017, 1:45:49 AM7/27/17
to Chromium-dev
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.io

I 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/1

I 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!

Thx

Ofer

Lei Zhang

unread,
Jul 27, 2017, 1:55:56 AM7/27/17
to ofer...@gmail.com, headless-dev
+headless-dev
-chromium-dev
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "Chromium-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/301a08fa-76c8-45a5-930e-54574650ec05%40chromium.org.
Reply all
Reply to author
Forward
0 new messages