3 ms·
If you print to PDF, you'll have the page's print css applied. And it is probably paginated. If you go direct to SVG the capture will use the screen css and no
by ccouzens 4y ago
If you print to PDF, you'll have the page's print css applied. And it is probably paginated.
If you go direct to SVG the capture will use the screen css and not be paginated.
- mk_stjames 4y agoYes, this. In the project I was doing, using chromium as a command-line interface I remember having options to do the pagination to a custom resolution, which I used to define a render 'window' as if the browser screen was on something like a 1600x18000 monitor. so I had the entire webpage displayed like a full scroll without page breaking like it would have if you just printed a PDF from Chrome. And this allowed me to then extract this giant full length vector graphics result of diagrams and text into a single SVG that was perfectly spaced and rendered in the aspect ratio I wanted.
- cjr 4y agoIt's also possible to emulate screen media queries[0] so that the pdf output uses the regular screen css. [0] https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia https://chromedevtools.github.io/devtools-protocol/tot/Emula...