PDF printing: Not entire PDF is printed when window is close

Having problems with building or using the JCEF Java binding? Ask your questions here.

Re: PDF printing: Not entire PDF is printed when window is c

Postby magreenblatt » Tue Nov 21, 2017 12:32 pm

Phylanx wrote:So, the utility process renders the PDF to EMF and tells the browser process when he is done.
Does he do that for every page he rendered?
So that the browser process sends every single page to the printer?

Each page is rendered separately. See CefPrintViewManagerBase::OnDidPrintPage. You'll need to dig into the printing implementation to see if they're sent to the printer individually or only after all pages have finished.

Phylanx wrote:When is the utility process terminated?

It should be after all pages have rendered.

Phylanx wrote:when the rendering is not finished yet and the browser process terminates, what happens? the utility process doesn't send the pages to the printer, so is this the problem?

Or is it possible that the browser process terminates the utility process (even UP isn't finish yet) when the Chromium GUI is disposed?

This is what you'll need to figure out.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Wed Nov 22, 2017 10:20 am

ok, thank you for the information.
I'll have a look on it.
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Fri Nov 24, 2017 8:26 am

I want to add logging so that I have more information about starting processes and termination of them.
I found the logging.cc where I can ensure that the PID/TID are logged too, which works fine for me.

Now I'm searching reliable places to add logging:
[*] Entry point of each process (the code that starts the new process and the "main" method having the parameters and its own PID)
[*] Points of process terminations (the one that initiates the termination and the one that is terminated)

And if possible a LOG call. Can the "LOG(INFO) << " keyword from the base/logging.h be used?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Tue Nov 28, 2017 12:00 pm

Are there specific places where I can add Logging for the places described in my last post?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: PDF printing: Not entire PDF is printed when window is c

Postby magreenblatt » Tue Nov 28, 2017 1:03 pm

You probably want content/browser/child_process_launcher*.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Mon Dec 04, 2017 8:53 am

That's the right spot :-)
I am able to do logging, but is there a chromium/cef/jcef way of dumping a native call stack?
I'd love to do that in some cases, it would save me a lot of searching...

thx, Phylanx
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: PDF printing: Not entire PDF is printed when window is c

Postby magreenblatt » Mon Dec 04, 2017 9:48 am

You can run the application and then attach the native debugger to the process. That would let you set breakpoints and view callstacks in the native code.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Mon Dec 04, 2017 10:26 am

Thanks, I already tried that but with the new code places, I now got a result.
The PrintJob is cancelled because of the closed window.
Closing the window closes the browser, but shouldn't the browser process wait for the print job to be done?
Attachments
PrintJobCancel.log
C stack of print job cancel
(2.14 KiB) Downloaded 604 times
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: PDF printing: Not entire PDF is printed when window is c

Postby magreenblatt » Mon Dec 04, 2017 1:09 pm

Phylanx wrote:Closing the window closes the browser, but shouldn't the browser process wait for the print job to be done?

I guess that depends on how long it might block application exit. How does Google Chrome handle this?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: PDF printing: Not entire PDF is printed when window is c

Postby Phylanx » Tue Dec 05, 2017 2:26 am

well, the print job is cancelled immediately when the window-X button is clicked.
I don't know how long Chrome would wait, but it waits at least for some time. But chrome has his printing dialog, might be that this has a special handling.

As long as the native print dialog is open, you can't click that X button because it is a modal dialog.
As soon as it is closed, the window can be closed too.

Is there a possibility for me to have a look on that chrome printing dialog code?

I heard, JCEF has a printing dialog on LINUX? Unfortunatly I can't test that, we only have windows machines.
Does the linux printing dialog handle that different?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

PreviousNext

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 21 guests