4 ms·
Yes: https://chromedevtools.github.io/debugger-protocol-viewer/tot/Page/#method-printToPDF https://chromedevtools.github.io/debugger-protocol-viewer/to...
by vvoyer 10y ago
Yes: https://chromedevtools.github.io/debugger-protocol-viewer/tot/Page/#method-printToPDF https://chromedevtools.github.io/debugger-protocol-viewer/to...
- jzfeng 10y agoThe print to pdf command currently only support default print settings. Adding support for customized page size, header and footer, dpi, etc. is in progress. Please see bug: https://bugs.chromium.org/p/chromium/issues/detail?id=603559 https://bugs.chromium.org/p/chromium/issues/detail?id=603559 for updates.
- masterleep 10y agoExcellent news, thanks!
- michael_miller 10y agoAny idea if you can configure the page DPI with this API?
- kenshaw 10y agoYes, the emulation domain has APIs for changing that.
- erikig 10y agohttps://wkhtmltopdf.org/ https://wkhtmltopdf.org/ You can download the two tools wkhtmltopdf and wkhtmltoimage which use WebKit to generate pdfs/images.
- Derbasti 10y agoNo paged media makes page formatting much too painful.
- adam77 10y agoSadly wkhtmltopdf's version of Webkit is ancient :( No flexbox, no es6, etc...
- codedokode 10y agoI think it just means that the site is poorly designed. I think websites should work correctly everywhere where CSS2.1 and ES3 is supported. Otherwise some users won't be able to view those sites.
- ashkulz 10y agoI'm the maintainer of wkhtmltopdf, and it's hopelessly out of date. There's still some bugs in the Chrome print-to-PDF support as support was added just a few days ago: https://bugs.chromium.org/p/chromium/issues/detail?id=603559 https://bugs.chromium.org/p/chromium/issues/detail?id=603559 Not sure if all the full functionality that wkhtmltopdf can be ported, it had patches to Qt/WebKit to enable that ... probably will need API enhancements in Chrome. Don't have the time right now, but I registered http://crhtmltopdf.org http://crhtmltopdf.org a while ago hoping that I'd get around to it.