3 ms·
It renders to canvas to draw the pdf so all it has is a bitmap, hence the bitmap printing. To get decent quality with bitmap printing you have to do really high
by SigmundA 6y ago
It renders to canvas to draw the pdf so all it has is a bitmap, hence the bitmap printing. To get decent quality with bitmap printing you have to do really high res which eats memory and is slow.
They were working on an SVG renderer to support proper vector printing still don’t think its done. They should have used SVG to begin with.
I actually like the idea of pdf.js, having a pure browser based pdf viewer is a good thing, really needs good vector print support though to be serious.
- maxerickson 6y agoDon't a lot of printer drivers pretty much support pdf though?
- pjmlp 6y agoOnly the Laser class ones, and definitely not the cheapest models.
- SigmundA 6y agoThe browser has no way to send anything directly to the printer through javascript and probably not the best idea to let it either from a security perspective, especially PDF's. It's up to the browser to render the page to the printer, if it contains canvases they are sent as bitmaps, since thats what they are. HTML elements and SVG are generally rendered as vector commands to the printer which might end up being postscript or pdf. So svg's are much lighter going to printer then high dpi canvases. They also looks much better too since the printer renders them to the final raster at native res say 600 dpi. Other browsers use a native PDF renders that can do whatever it wants, not sure what PDFium does in Chrome/Edge maybe it just sends the PDF if it can determine the printer supports it, otherwise it does native print commands for sure, it does not send bitmaps. The nice thing about pdf.js is it runs on platforms that have no pdf viewer built in but have a web browser or maybe a buggy built in one. You can also style and control it yourself and add features to it for your app making for tighter embedding. Also it can be updated independently of browser.