2 ms·
Nicely done! For non-React users (and React users, for that matter), I started working on wrapping PDF.js up into a web component for use in any framework or i
by spankalee 7y ago
Nicely done!
For non-React users (and React users, for that matter), I started working on wrapping PDF.js up into a web component for use in any framework or in plain HTML or Markdown: https://www.npmjs.com/package/pdf-viewer-element https://www.npmjs.com/package/pdf-viewer-element
The idea is to make a `<pdf-viewer>` element that's as easy to use as if it were built-in to the browser.
As PDF.js Express shows, this is a pretty deep UI and feature area to tackle. My project is incomplete and doesn't have anywhere close to the features.
I think complex viewers are one of the ideal use cases for web components though. These components require a lot of work to do well, and we shouldn't have to re-implement them for every framework. The 3D gltf viewer, `<model-viewer>`[1] is another great example.
[1]: https://modelviewer.dev/ https://modelviewer.dev/