Skip to content

Commit

Permalink
update pdfjs-dist imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Washburn committed May 8, 2024
1 parent 2477b05 commit 88e8f22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/app/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { from, fromEvent, Subject } from 'rxjs';
import { debounceTime, filter, takeUntil } from 'rxjs/operators';
import * as PDFJS from 'pdfjs-dist';
import * as PDFJSViewer from 'pdfjs-dist/web/pdf_viewer';
import * as PDFJSViewer from 'pdfjs-dist/web/pdf_viewer.mjs';

import { createEventBus } from '../utils/event-bus-utils';
import { assign, isSSR } from '../utils/helpers';
Expand All @@ -32,7 +32,7 @@ import type {
PDFViewerOptions,
ZoomScale
} from './typings';
import { PDFSinglePageViewer } from 'pdfjs-dist/web/pdf_viewer';
import { PDFSinglePageViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';

if (!isSSR()) {
assign(PDFJS, 'verbosity', PDFJS.VerbosityLevel.INFOS);
Expand Down Expand Up @@ -289,9 +289,9 @@ export class PdfViewerComponent
this.loadPDF();
} else if (this._pdf) {
if ('renderText' in changes) {
this.pdfViewer.textLayerMode = this._renderText
? this._renderTextMode
: RenderTextMode.DISABLED;
// this.pdfViewer.textLayerMode = this._renderText
// ? this._renderTextMode
// : RenderTextMode.DISABLED;
this.resetPdfDocument();
} else if ('showAll' in changes) {
this.setupViewer();
Expand Down Expand Up @@ -341,7 +341,7 @@ export class PdfViewerComponent
stickToPage = !this._stickToPage;
}

this.pdfViewer._setScale(scale, stickToPage);
this.pdfViewer.currentScale = scale;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pdf-viewer/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type PDFPageProxy = import('pdfjs-dist/types/src/display/api').PDFPagePro
export type PDFSource = import('pdfjs-dist/types/src/display/api').DocumentInitParameters;
export type PDFDocumentProxy = import('pdfjs-dist/types/src/display/api').PDFDocumentProxy;
export type PDFDocumentLoadingTask = import('pdfjs-dist/types/src/display/api').PDFDocumentLoadingTask;
export type PDFViewerOptions = import('pdfjs-dist/types/web/base_viewer').PDFViewerOptions;
export type PDFViewerOptions = import('pdfjs-dist/types/web/pdf_viewer').PDFViewerOptions;

export interface PDFProgressData {
loaded: number;
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/event-bus-utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fromEvent, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

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

// interface EventBus {
// on(eventName: string, listener: Function): void;
Expand Down

0 comments on commit 88e8f22

Please sign in to comment.