-
-
Notifications
You must be signed in to change notification settings - Fork 478
PDF printing support #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm interested in this. I'm using both chromium (custom hacked with a couple of weird features) and cefpython but still using phantomjs for rendering docs as PDF. How hard is it to implement something like this? I've had a look through cefpython previously and it seems that much of the work is in mapping all the datatypes and function calls between cefpython and cef (though I'm not very familiar with pyx) - is that correct? |
@aidos It's a matter of exposing the API above, so it's pretty easy:
|
Also when adding new functions you should update API docs - the api/ directory. PR is welcome. |
For editing cefpython code I recommend PyCharm - see config in Issue #232. |
Ok great! I'll take a look when I get a moment. First I'll get the build running locally and then I can take a stab at adding the functionality. Ultimately I want to run my custom chromium build via cefpython so this was already on my list (I know there are a couple of patches to cef required to make them play nice). |
For adding custom Chromium/CEF patches to CEF Python see patches/patch.py and Build instructions doc > How to patch. It's best to send them upstream. |
https://github.com/qq18436558/cefpython Test OnFileDialog and OnPdfPrintFinished on Mac and Win10 in wxpython.py |
This commit from @qq18436558 be added? |
It needs to go through a PR review process. PDF printing and file dialog callback should be sent as separate PRs, unless they depend on each other. |
@cztomczak I'm also very interested in this feature. I'd posted a question on SO a while back about this very function and just came across your work here. Do you have any projection of a timeline for this? I don't see a PR from @qq18436558 with the changes they made - does one need to be opened? |
See #422 |
How to use it in Python? |
Uh oh!
There was an error while loading. Please reload this page.
Printing to PDF can be performed in two ways:
When print dialog appears you should see "Print to PDF" option (printer). This is already available.
There is a new method CefBrowserHost::PrintToPDF(), but this wasn't yet exposed in CEF Python.
See these commits by cuijinbao for reference: aec3474 and 7dc6d7d .
Below is the code from CEF header files that would need to be exposed:
PrintToPDF function
Print settings
Print callback
The text was updated successfully, but these errors were encountered: