Skip to content

Commit 88e8f22

Browse files
author
Andrew Washburn
committed
update pdfjs-dist imports
1 parent 2477b05 commit 88e8f22

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/app/pdf-viewer/pdf-viewer.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { from, fromEvent, Subject } from 'rxjs';
1919
import { debounceTime, filter, takeUntil } from 'rxjs/operators';
2020
import * as PDFJS from 'pdfjs-dist';
21-
import * as PDFJSViewer from 'pdfjs-dist/web/pdf_viewer';
21+
import * as PDFJSViewer from 'pdfjs-dist/web/pdf_viewer.mjs';
2222

2323
import { createEventBus } from '../utils/event-bus-utils';
2424
import { assign, isSSR } from '../utils/helpers';
@@ -32,7 +32,7 @@ import type {
3232
PDFViewerOptions,
3333
ZoomScale
3434
} from './typings';
35-
import { PDFSinglePageViewer } from 'pdfjs-dist/web/pdf_viewer';
35+
import { PDFSinglePageViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
3636

3737
if (!isSSR()) {
3838
assign(PDFJS, 'verbosity', PDFJS.VerbosityLevel.INFOS);
@@ -289,9 +289,9 @@ export class PdfViewerComponent
289289
this.loadPDF();
290290
} else if (this._pdf) {
291291
if ('renderText' in changes) {
292-
this.pdfViewer.textLayerMode = this._renderText
293-
? this._renderTextMode
294-
: RenderTextMode.DISABLED;
292+
// this.pdfViewer.textLayerMode = this._renderText
293+
// ? this._renderTextMode
294+
// : RenderTextMode.DISABLED;
295295
this.resetPdfDocument();
296296
} else if ('showAll' in changes) {
297297
this.setupViewer();
@@ -341,7 +341,7 @@ export class PdfViewerComponent
341341
stickToPage = !this._stickToPage;
342342
}
343343

344-
this.pdfViewer._setScale(scale, stickToPage);
344+
this.pdfViewer.currentScale = scale;
345345
}
346346
});
347347
}

src/app/pdf-viewer/typings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type PDFPageProxy = import('pdfjs-dist/types/src/display/api').PDFPagePro
22
export type PDFSource = import('pdfjs-dist/types/src/display/api').DocumentInitParameters;
33
export type PDFDocumentProxy = import('pdfjs-dist/types/src/display/api').PDFDocumentProxy;
44
export type PDFDocumentLoadingTask = import('pdfjs-dist/types/src/display/api').PDFDocumentLoadingTask;
5-
export type PDFViewerOptions = import('pdfjs-dist/types/web/base_viewer').PDFViewerOptions;
5+
export type PDFViewerOptions = import('pdfjs-dist/types/web/pdf_viewer').PDFViewerOptions;
66

77
export interface PDFProgressData {
88
loaded: number;

src/app/utils/event-bus-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fromEvent, Subject } from 'rxjs';
22
import { takeUntil } from 'rxjs/operators';
33

4-
import type { EventBus } from 'pdfjs-dist/web/pdf_viewer';
4+
import type { EventBus } from 'pdfjs-dist/web/pdf_viewer.mjs';
55

66
// interface EventBus {
77
// on(eventName: string, listener: Function): void;

0 commit comments

Comments
 (0)