Adding Print Options to Cef3
Original issue 1283 created by biskark on 2014-05-12T18:11:08.000Z:
Now that printing has been added to Cef3, is there any work being done to adding the ability to modify the PrintSettings programatically? This feature was exposed in Cef1 and is something my team would like to keep as we move to Cef3. This was previously exposed in the CefPrintHandler class which no longer exists.
Comments (20)
-
-
Account Deleted Comment 3. originally posted by biskark on 2014-05-12T19:01:15.000Z:
Good to know, I will look into a patch.
-
Account Deleted - attached cef_patch.txt
- attached chromium_patch.txt
Comment 4. originally posted by biskark on 2014-06-05T18:29:33.000Z:
So these are my initial changes to get this working. This will likely only work for Windows builds, and both patches must be used for this to work. I had to make changes to both Cef and Chromium. The CefClient has an example of how these can be used. For those interested in this feature, let me know what you think.
-
Comment 5. originally posted by magreenblatt on 2014-06-12T20:34:00.000Z:
Thanks for the patches. Printing on Windows is currently broken after the most recent Chromium update (see issue comment 13.13). That will need to be resolved before moving forward with these changes.
-
Account Deleted Comment 6. originally posted by randa.jakub on 2014-07-16T08:26:37.000Z:
Any news about integrating this into CEF3? Would be really helpful for us.
-
Account Deleted Comment 7. originally posted by cameron.howey on 2014-08-30T01:59:58.000Z:
Windows printing seems to work fine now, is this feature now on the agenda?
-
Account Deleted Comment 8. originally posted by olda.esner on 2014-09-26T08:45:54.000Z:
We try to bind CefPrintHandler in CefBrowserProcessHandler class but we can't catch print event (Windows 7, fork of Xillium project with CEF 3.2062.1835).
If you click on window.print function you'll get only print dialog without any event inside .NET code.
Have you tried to test this function also on Windows OS?
-
Comment 9. originally posted by magreenblatt on 2014-09-26T15:37:57.000Z:
@ comment 8.: As stated in the comments the CefPrintHandler class is only used on Linux.
-
Account Deleted Comment 10. originally posted by olda.esner on 2014-09-26T15:52:29.000Z:
@ comment 9.: Is there any chance to use CefPrintHandler also on Windows? What should we (or someone else) do to enable this function on Windows OS?
We need to suppress print dialog in order to print silently.
-
Comment 11. originally posted by magreenblatt on 2014-09-26T15:56:25.000Z:
@ comment 10.: I would like to eventually expose CefPrintHandler on other platforms but at this time it would require substantial changes to Chromium.
-
Account Deleted Comment 12. originally posted by olda.esner on 2014-09-26T15:59:35.000Z:
@ comment 10.: Is there any ticket that is going to solve this substantial changes or any future plan to implement print on Windows?
-
Account Deleted Comment 13. originally posted by marshall@chromium.org on 2014-09-26T16:06:40.000Z:
@ comment 12.: You can follow http://crbug.com/311308 which tracks refactoring of the Chromium printing implementation.
-
The linked Issue changed to Fixed. How is the status? Will printing be better supported in Windows OS in future?
-
Chrome's print extension shows some options like "fit in page" that don't appear on the standard OS print dialog. It would therefore be necessary for the client to implement a custom print dialog and feed the settings back into CEF. We have a similar implementation on Linux with CefPrintHandler and CefPrintSettings, but that implementation is platform-specific and does not address non-standard options like "fit in page".
-
As mentioned above, we would need that mechanism for the WinOS too. Is there anything planned in near future?
-
- edited description
- changed component to Framework
- marked as enhancement
-
- attached cef_silent_print_2526.patch
- attached chromium_silent_print_2526.patch
I have implemented silent print in branch 2171 and it works fine for WinOS. This mechanism is asynchronious and has two handlers - OnPrintingFinished and OnPrintingFailed. I attached patch for branch 2526, it also works fine for Windows but can't be applied because 2526 building is not yet supported. For newer branches i don't now how to modify chromium. Everything works for cef, but chromium part has two bugs: 1. Silent printing fails during printing (FrameHostMsg_RenderProcessGone message received). 2. Handlers are never called. Maybe i'll solve this problems in future, but now i haven't enough time to work with it.
-
Issue
#1474was marked as a duplicate of this issue. -
Issue
#2453was marked as a duplicate of this issue. -
@magreenblatt Is there anyway to tell CEF to use the CEFPrintHandler - Codepath instead of the Platform Dialogues as it does for linux?
- Log in to comment
Comment 1. originally posted by magreenblatt on 2014-05-12T18:33:35.000Z:
No work currently in-progress. Patches welcome.