svelte-pdfjs
Advanced tools
Comparing version 0.1.2 to 0.1.3
export { default as Document } from './PDFViewer/Document.svelte'; | ||
export { default as Page } from './PDFViewer/Page.svelte'; | ||
import * as PDFJS from 'pdfjs-dist'; | ||
export { PDFJS }; |
export { default as Document } from './PDFViewer/Document.svelte'; | ||
export { default as Page } from './PDFViewer/Page.svelte'; | ||
import * as PDFJS from 'pdfjs-dist'; | ||
if (PDFJS.GlobalWorkerOptions) { | ||
PDFJS.GlobalWorkerOptions.workerSrc = `https://cdn.jsdelivr.net/npm/pdfjs-dist@${PDFJS.version}/build/pdf.worker.min.js`; | ||
} | ||
export { PDFJS }; |
{ | ||
"name": "svelte-pdfjs", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"devDependencies": { | ||
"@sveltejs/adapter-netlify": "^1.0.0-next.36", | ||
"@sveltejs/adapter-netlify": "^1.0.0-next.37", | ||
"@sveltejs/kit": "next", | ||
@@ -37,3 +37,3 @@ "@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"svelte": "./index.js", | ||
"readme": "## svelte-pdfjs\r\n\r\nA 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.\r\n\r\n## Usage\r\nSee [src/routes/index.svelte](src/routes/index.svelte) \r\nDemo: [Netlify](https://svelte-pdfjs.netlify.app)\r\n\r\n## SvelteKit\r\n\r\nIt's compatible with SvelteKit, just import the component and use it. No onMount shenanigans required in the consumer since it's already done within the PDFViewer component.\r\n\r\n## TODOs: \r\n- [x] Text layer rendering\r\n- [x] SvelteKit compatibility\r\n- [ ] Think of a better name for the `zoomLevel` prop on `Page`\r\n- [ ] SVG renderer\r\n- [ ] Annotation layer\r\n- [ ] Error handling\r\n- [ ] Expose more stuff\r\n\r\n## License\r\n\r\n[MIT](LICENSE)\r\n" | ||
"readme": "## svelte-pdfjs\n\nA 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.\n\n## Usage\n\nSee [src/routes/index.svelte](src/routes/index.svelte) \nDemo: [Netlify](https://svelte-pdfjs.netlify.app)\n\n## SvelteKit\n\nIt's compatible with SvelteKit, just import the component and use it. No onMount shenanigans required in the consumer since it's already done within the PDFViewer component.\n\n## TODOs:\n\n- [x] Text layer rendering\n- [x] SvelteKit compatibility\n- [ ] Think of a better name for the `zoomLevel` prop on `Page`\n- [ ] SVG renderer\n- [ ] Annotation layer\n- [ ] Error handling\n- [ ] Expose more stuff\n\n## License\n\n[MIT](LICENSE)\n" | ||
} |
import { SvelteComponentTyped } from "svelte"; | ||
declare type MultipleOf90 = 0 | 90 | 180 | 270; | ||
declare const __propDef: { | ||
@@ -6,3 +7,4 @@ props: { | ||
* What renderer implementation to use for the page. | ||
* Defaults to canvas. SVG rendering not implemented yet. | ||
* SVG rendering not implemented yet. | ||
* @default {"canvas"} | ||
*/ renderer?: 'canvas' | 'svg'; | ||
@@ -14,2 +16,3 @@ /** | ||
* The scale to show the PDF at. | ||
* @default {1} | ||
*/ zoomLevel?: number; | ||
@@ -26,3 +29,4 @@ /** | ||
* Rotate the page by a multiple of 90 degrees. | ||
*/ rotation?: 0 | 90 | 180 | 270; | ||
* @default {0} | ||
*/ rotation?: MultipleOf90; | ||
}; | ||
@@ -29,0 +33,0 @@ events: { |
import { SvelteComponentTyped } from "svelte"; | ||
import type { PDFPageProxy } from 'pdfjs-dist/types/src/display/api'; | ||
import type { PageViewport } from 'pdfjs-dist/types/src/display/display_utils'; | ||
declare const __propDef: { | ||
props: { | ||
pageNumber?: number; | ||
zoomLevel?: number; | ||
targetHeight?: number; | ||
targetWidth?: number; | ||
rotation?: 0 | 90 | 180 | 270; | ||
page: PDFPageProxy; | ||
viewport: PageViewport; | ||
}; | ||
@@ -10,0 +9,0 @@ events: { |
@@ -6,2 +6,3 @@ ## svelte-pdfjs | ||
## Usage | ||
See [src/routes/index.svelte](src/routes/index.svelte) | ||
@@ -14,3 +15,4 @@ Demo: [Netlify](https://svelte-pdfjs.netlify.app) | ||
## TODOs: | ||
## TODOs: | ||
- [x] Text layer rendering | ||
@@ -17,0 +19,0 @@ - [x] SvelteKit compatibility |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17538
188
27