fix getPageCount called before documentLoaded

This commit is contained in:
Dan Percic 2022-03-11 14:27:24 +02:00
parent 582f96ff33
commit 92859462c8

View File

@ -85,7 +85,12 @@ export class PdfViewer {
}
private get _totalInternalPages() {
return this.documentViewer?.getPageCount() ?? 1;
try {
return this.documentViewer?.getPageCount() ?? 1;
} catch {
// might throw Error: getPageCount was called before the 'documentLoaded' event
return 1;
}
}
hideAnnotations(annotations: Annotation[]): void {