by ivdone » Fri Oct 20, 2017 4:31 pm
Please find the patch in the attachment.
Here are some reasoning about the changes I made, I hope this could help you navigate through the changes.
1. print preview will be initiated by PrintViewManager instead of CefPrintViewManager because PrintPreviewHandler will try to retrieve a PrintViewManager. One solution is to create a Cef version of those classes, but that will involve a lot of files so I didn't do that.
2. The 'path' related patch are used for enable the download manager. Which will be used by 'print to pdf' in print preview.
3. I have changed the way how browserInfoManager is destroying browserInfos. Because the printpreview dialog will not have a browserHost, thus I will create a PopupBrowserInfo
manually in CefPrintPreviewMessageHandler. And BrowserInfoManager will be responsible to destroy those browserInfo. I think this is not a good way to implement it but I cannot seem to find a easy way around. Do you have any sugguestions?
It is still experiencing an flaw after resizing. When the host window is resized, the print preview will not resize accordingly. Do you guys have any sugguestions on how to do that?
Any help will be appreciated!
Thanks,
- Attachments
-
- print_preview_patch_cef.txt
- (38.83 KiB) Downloaded 1077 times