3 ms·
Fun fact about subpixel antialiasing: at some point, Firefox was printing the subpixels when printing PDFs displayed with PDF.js. That looked awful. I'm actuall
by glandium 7y ago
Fun fact about subpixel antialiasing: at some point, Firefox was printing the subpixels when printing PDFs displayed with PDF.js. That looked awful. I'm actually not sure whether that was fixed, as I haven't printed in years (also, I have disabled subpixel AA for a while because of my dual monitor not in the same direction setup)
- sokoloff 7y agoI got some printed marketing material at a trade show last week. Screenshot of grey sub-pixel text, enlarged and printed in CMYK onto flyers. Obviously blurry and color-fringed; hard to believe anyone approved that artwork or finished product.
- stallmanite 7y agoPerhaps it was an artistic choice? Doubtful depending on what the marketing material was for but I’ve seen interesting stuff along those lines. A good analogy would be how some people like the sound of “cheap” synthesizers.
- srbby 7y agoProbably because pdf.js is implemented using <canvas> so it's basically like printing screenshots of the PDF
- SigmundA 7y agoThey have been working on SVG backend for quite a while to get real vector printing, still not done.
- leni536 7y agoI am not surprised, given the poor SVG support of Firefox (and browsers in general). Also there are gradient types that PDF supports but SVG doesn't. I am also not sure why they would need to go through SVG for printing.
- SigmundA 7y agoSVG is the only way to get vector printing through a browser currently unless its just normal html/css which isn't enough to render a pdf. Canvas is just a bitmap so when printing pdf.js renders to a certain dpi canvas which I believe is less than 300 dpi (150?) which even still uses huge memory and ends up with fuzzy text. You don't want bitmaps going to printer for text and line art, you want vector so it can come out at 600+ dpi while using minimal memory.
- leni536 7y ago> SVG is the only way to get vector printing through a browser currently This is what seems weird. Why is that? Also it's not like most printer drivers don't need to convert it back to ps or pdf before printing.
- SigmundA 7y agoYou can't convert a bitmap back into vectors (well maybe image recognition of some sort). Once you render to canvas its a bitmap and stays that way all the way to printer. SVG is turned into the appropriate PS/PDF vector drawing command by the browser print engine, canvas just gets sent as a bitmap in the printer language since that all that's left. I believe pdf.js incorporated and modified https://github.com/gliffy/canvas2svg https://github.com/gliffy/canvas2svg which implements the canvas api but instead creates an SVG dom.
- leni536 7y agoYeah, ok, so we have essentially PDF -> SVG -> PDF/PS because of too many abstractions. It would make sense to expose some internal printing API to the embedded PDF reader so all this nonsense wouldn't be necessary.
- SigmundA 7y agoFirefox tried to with mozPrintCallback specifically for pdf.js, then went away from that. Not sure what happened behind the scenes exactly as they wanted to get it standardized for canvas printing. Printing is a forgotten corner on the web, would be nice if a mainstream browser implemented the full css print spec too so we could create page perfect output without relying on PrinceXml...
- jancsika 7y agoSo your printer would literally leak information about your display?