Hacker News new | ask | show | jobs
by phonon 2276 days ago
The form fill demo only prints a bitmap. Is that intentional? The quality is completely unacceptable.
1 comments

Yes, unfortunately the printing is done with a bitmap because of the lack of browser APIs to print scalable canvas content. It looks like our default print quality is a bit on the low side though, so we'll probably change that. You can use the API to increase the quality as well https://pdfjs.express/api/WebViewerInstance.html#setPrintQua..., for example instance.setPrintQuality(2).
Well, capturing a 72 dpi screenshot and converting to JPEG (which more or less seems to be what you're doing) kind of makes the form filling pointless. Fillable PDF forms exist so they can be printed (or saved and then printed, which I don't think you have an option for either?)
The right way to handle this would be to work with pdf.js, which has been discussing pdf form printing for quite a long time[1],instead of rolling a canvas screenshot hack.

[1]https://github.com/mozilla/pdf.js/issues/7613