We kept it up-to-date pretty well, but we kept hitting problems with the way the package is built that were hard to work around. But the worst part was probably the difficulty it posed to day-to-day development. We definitely had bugs related to it that affected users. The initial wrapper didn’t support things like Apple retina rendering, web workers, re-rendering on window resize, and more.Īt the time it looked like the trouble might be over, but in the end for better or for worse, PDF.js was always a problem for the Insomnia app (even after we brought it in as a direct dependency). Sadly, it was only two short months before the initial implementation broke completely and we had to remove simple-react-pdf and do a total rewrite using PDF.js directly. No way to download, print, zoom, scroll by page, fit to window… nothing to help the user out aside from the bare minimum. The PDF renders, but there’s nothing else. It’s much better than nothing, but it’s pretty close to nothing. Here’s how it looked with PDF.js in late June 2017 when the first PR merged. Originally, we consumed this via a package that added some nice babel transforms and React bindings, `simple-react-pdf`. ) they distribute this project under the npm `pdfjs-dist`. Since the `pdfjs` NPM was already taken and this was before the days of npm package namespace prefixing (e.g. It reads and parses a PDF document using ordinary web technology and uses HTML5 canvas to display it on screen. PDF.js has been the native PDF rendering engine in Firefox since Firefox 19 in 2013, and has steadily improved over the years in its ability to render PDFs accurately. Mozilla’s fantastic open-source offerings save the day again! If you spend any time at all looking for pure-JavaScript implementations for PDF viewers, you’ll quickly find out about Mozilla’s PDF reader, PDF.js. Although it probably won’t ever achieve the same performance and robustness as a native PDF viewer, it is a compelling option from many other standpoints.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |