fix getPageCount called before documentLoaded
This commit is contained in:
parent
582f96ff33
commit
92859462c8
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user