Skip to content

Immortalin/svelte-pdfjs

 
 

Repository files navigation

svelte-pdfjs

A wrapper around Mozilla's PDFJS renderer. Only cares about loading and showing the PDF and nothing else, all the fancy stuff such as styling the viewer is left up to the consumer. Still in early stages so feel free to create an issue or a PR for any bugs that you find, any improvements or feature requests.

Usage

See src/routes/index.svelte
Demo: Netlify

SvelteKit

It's compatible with SvelteKit, just import the component and use it in a {#if browser} you'll have to install pdfjs-dist as a dependency.

TODOs:

  • Text layer rendering
  • SvelteKit compatibility
  • Think of a better name for the zoomLevel prop on Page
  • SVG renderer
  • Annotation layer
  • Error handling
  • Expose more stuff

License

MIT

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Svelte 76.9%
  • TypeScript 12.6%
  • JavaScript 8.2%
  • HTML 2.3%