ng2-pdfjs-viewer 26.0.2 → 26.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/fesm2022/ng2-pdfjs-viewer.mjs +9 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
**A complete PDF experience in one Angular component — view, annotate, sign, fill forms, search, and read aloud, powered by Mozilla PDF.js.**
|
|
8
8
|
|
|
9
|
+
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
9
10
|
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
10
11
|
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
11
|
-
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
12
12
|
[](https://github.com/intbot/ng2-pdfjs-viewer/blob/master/BILL-OF-MATERIALS.md)
|
|
13
|
-
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
14
|
+
[](https://github.com/intbot/ng2-pdfjs-viewer/security/code-scanning)
|
|
14
15
|
[](https://angular.dev)
|
|
16
|
+
[](https://github.com/mozilla/pdf.js)
|
|
15
17
|
[](https://github.com/intbot/ng2-pdfjs-viewer/blob/master/LICENSE)
|
|
16
18
|
[](https://github.com/intbot/ng2-pdfjs-viewer)
|
|
17
|
-
[](https://scorecard.dev/viewer/?uri=github.com/intbot/ng2-pdfjs-viewer)
|
|
18
19
|
|
|
19
20
|
[**Live demo**](https://angular-pdf-viewer-demo.vercel.app/) · [**Documentation**](https://angular-pdf-viewer-docs.vercel.app/) · [**API reference**](https://angular-pdf-viewer-docs.vercel.app/docs/api/component-inputs) · [**Changelog**](https://github.com/intbot/ng2-pdfjs-viewer/blob/master/CHANGELOG.md)
|
|
20
21
|
|
|
@@ -2347,11 +2347,16 @@ class PdfJsViewerComponent {
|
|
|
2347
2347
|
const base = this.viewerFolder
|
|
2348
2348
|
? `${this.viewerFolder}/web/viewer.html`
|
|
2349
2349
|
: `assets/pdfjs/web/viewer.html`;
|
|
2350
|
-
|
|
2350
|
+
// Control params go in the query string first; the file URL is appended
|
|
2351
|
+
// LAST. A consumer's file URL may end in a hash fragment that PDF.js reads
|
|
2352
|
+
// for navigation (e.g. doc.pdf#search=foo, #page=2). Anything appended
|
|
2353
|
+
// after the file param would land inside that fragment instead of the
|
|
2354
|
+
// query string - so file trails the whole URL, leaving the hash where
|
|
2355
|
+
// PDF.js looks for it. (#305)
|
|
2356
|
+
let viewerUrl = `${base}?urlValidation=${this.urlValidation === false ? 0 : 1}`;
|
|
2351
2357
|
if (typeof this.viewerId !== "undefined") {
|
|
2352
2358
|
viewerUrl += `&viewerId=${this.viewerId}`;
|
|
2353
2359
|
}
|
|
2354
|
-
viewerUrl += `&urlValidation=${this.urlValidation === false ? 0 : 1}`;
|
|
2355
2360
|
// Init-time PDF.js options (signature editor, page colors, passthrough).
|
|
2356
2361
|
// These are read by PDF.js during initialize() - before the postMessage
|
|
2357
2362
|
// channel exists - so they ride the viewer URL and are applied by the
|
|
@@ -2367,6 +2372,8 @@ class PdfJsViewerComponent {
|
|
|
2367
2372
|
if (isDevMode()) {
|
|
2368
2373
|
viewerUrl += `&_t=${Date.now()}`;
|
|
2369
2374
|
}
|
|
2375
|
+
// File last (see above): its optional #hash fragment must trail the URL.
|
|
2376
|
+
viewerUrl += `&file=${fileUrl}`;
|
|
2370
2377
|
return viewerUrl;
|
|
2371
2378
|
}
|
|
2372
2379
|
// Merge the dedicated convenience inputs with the raw pdfJsOptions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng2-pdfjs-viewer",
|
|
3
|
-
"version": "26.0.
|
|
3
|
+
"version": "26.0.3",
|
|
4
4
|
"description": "The most comprehensive Angular PDF viewer, powered by Mozilla PDF.js 6 — view, annotate, sign, fill forms, search, and read aloud from one component. 8.3M+ downloads, mobile-first, production-ready.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aneesh Goapalakrishnan",
|