-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding feature print-media-type #3
Comments
It's not supported yet, but that's certainly an interesting option to add if possible with CEF. Just to be sure you're referring to something like this, and being able to choose between print and screen ?
|
Thanks for the reply. Many thanks for the support. |
If you have one exemple and it's not confidential, please provide it, it may bring forward issues that do not exist on a more simplistic test case. I did a a quick full text search on the CEF and web, and could not find an option, though Chrome supports such an option, so it could just be a matter of searching harder. As a workaround, using the snippet at https://stackoverflow.com/questions/37080744/is-there-a-way-to-enable-media-print-css-to-a-normal-view with the --javascript option may work to force media print or media screen.
It's just a regexp though, so it'll be vulnerable to all kinds of failures... but in a well define context, it could be good enough. |
I can provide an example. They are of public domain, in a site that has no login whatsoever. This file is a typical html file that I should convert to pdf and, currently, using wkhtmltopdf to do the job. If you, from your browser, print the file, you can get the style defined for print media type. That's the style i should use to generate the PDFs. Many thanks by your efforts. |
I tested with the html file you provided, and with a pdf output I got the "media print" version while the jpg output resulted in the "media screen" version. Ar you after getting the "media screen" version for the pdf output, or the "media print" for the jpg version ? (both would be best I guess, but gotta start somwehere) |
Hi. Therefore, it looks pretty fine like that. Many thanks for your time on this. |
No idea about the definitive version: it is going to chase the CEF PDF support, which as of CEF 89 appears broken in some way :/ |
Ok Eric. Most appreciate the your work. |
Hi.
I'm using the wkhtmltopdf tool a while ago now. Because the html that I'm transforming to pdf has styling for screen and print views, i'm using the --print-media-type option to get the printing style, since the need is to have a "printed" version of the document.
I am not seeing that option in your help.
Is that option lacking or are there any plans to add it in a future version?
Many thanks for the great tool.
The text was updated successfully, but these errors were encountered: