Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-pdfjs

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-pdfjs - npm Package Compare versions

Comparing version 0.4.0-rc.0 to 0.4.0

7

CHANGELOG.md
# svelte-pdfjs
## 0.4.0
### Minor Changes
- a9ef4d6: [breaking] make pdfjs-dist a peer dep, add setWorkerSrc
## 0.4.0-rc.0

@@ -4,0 +11,0 @@

2

package.json
{
"name": "svelte-pdfjs",
"version": "0.4.0-rc.0",
"version": "0.4.0",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=16.0.0"

@@ -6,9 +6,10 @@ ## svelte-pdfjs

## Usage
See [src/routes/index.svelte](src/routes/index.svelte)
See [src/routes/+page.svelte](src/routes/+page.svelte)
[Demo](https://gtm-nayan.github.io/svelte-pdfjs)
## SvelteKit
## Custom worker source
You can provide a custom worker URL using `setWorkerSrc`, see [src/routes/+layout.ts](src/routes/+layout.ts)
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.
## SSR
For now this package cannot be used with SSR, contributions to improve in that area are more than welcome. Because of how pdfjs-dist is packaged, there is an eval which prevents bundlers from properly minifying whatever chunk it ends up in. To get around it, you can patch your installation of pdfjs-dist such that all instances of `_is_node.isNodeJs` are replaced with `false` since those parts aren't going to be used anyway.

@@ -19,3 +20,2 @@ ## TODOs:

- [x] SvelteKit compatibility
- [ ] Think of a better name for the `zoomLevel` prop on `Page`
- [ ] SVG renderer

@@ -22,0 +22,0 @@ - [ ] Annotation layer

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc