Skip to content

Commit 0f1954c

Browse files
committed
BUG - #287
1 parent 3cb51fd commit 0f1954c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng2-pdfjs-viewer",
3-
"version": "25.0.13",
3+
"version": "25.0.14",
44
"description": "The most comprehensive Angular PDF viewer powered by Mozilla PDF.js. 7M+ downloads, mobile-first, production-ready with complete rewrite in v25.x",
55
"author": {
66
"name": "Aneesh Goapalakrishnan",

lib/src/ng2-pdfjs-viewer.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,10 @@ export class PdfJsViewerComponent
939939
this.actionQueueManager.processQueuedActions();
940940
}
941941

942-
// Queue all initial configurations now that PostMessage API is ready (only once)
943-
if (!this.initialConfigQueued) {
944-
this.queueAllConfigurations();
945-
this.initialConfigQueued = true;
946-
}
942+
// Always (re)apply initial configurations when PostMessage API is ready.
943+
// This makes reloads idempotently reconfigure the viewer.
944+
this.queueAllConfigurations();
945+
this.initialConfigQueued = true;
947946

948947
// Apply any pending changes that occurred before PostMessage API was ready
949948
this.applyPendingChanges();
@@ -1918,7 +1917,9 @@ export class PdfJsViewerComponent
19181917
this.relaseUrl = () => URL.revokeObjectURL(url);
19191918
return encodeURIComponent(url);
19201919
} else if (this._src instanceof Uint8Array) {
1921-
let blob = new Blob([this._src], { type: "application/pdf" });
1920+
// Ensure BlobPart type safety by passing ArrayBuffer
1921+
const arrayBuffer = (this._src as Uint8Array).buffer as ArrayBuffer;
1922+
let blob = new Blob([arrayBuffer], { type: "application/pdf" });
19221923
const url = URL.createObjectURL(blob);
19231924
this.relaseUrl = () => URL.revokeObjectURL(url);
19241925
return encodeURIComponent(url);

0 commit comments

Comments
 (0)