Page 2 of 3

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

PostPosted: Tue Nov 21, 2017 12:32 pm
by magreenblatt
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.

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

PostPosted: Wed Nov 22, 2017 10:20 am
by Phylanx
ok, thank you for the information.
I'll have a look on it.

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

PostPosted: Fri Nov 24, 2017 8:26 am
by Phylanx
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?

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

PostPosted: Tue Nov 28, 2017 12:00 pm
by Phylanx
Are there specific places where I can add Logging for the places described in my last post?

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

PostPosted: Tue Nov 28, 2017 1:03 pm
by magreenblatt
You probably want content/browser/child_process_launcher*.

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

PostPosted: Mon Dec 04, 2017 8:53 am
by Phylanx
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

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

PostPosted: Mon Dec 04, 2017 9:48 am
by magreenblatt
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.

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

PostPosted: Mon Dec 04, 2017 10:26 am
by Phylanx
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?

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

PostPosted: Mon Dec 04, 2017 1:09 pm
by magreenblatt
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?

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

PostPosted: Tue Dec 05, 2017 2:26 am
by Phylanx
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?