diff --git a/src/core/document.js b/src/core/document.js index c970399da..cd459f6f7 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -573,7 +573,8 @@ class PDFDocument { } parse(recoveryMode) { - this.setup(recoveryMode); + this.xref.parse(recoveryMode); + this.catalog = new Catalog(this.pdfManager, this.xref); // The `checkHeader` method is called before this method and parses the // version from the header. The specification states in section 7.5.2 @@ -676,11 +677,6 @@ class PDFDocument { this.xref.setStartXRef(this.startXRef); } - setup(recoveryMode) { - this.xref.parse(recoveryMode); - this.catalog = new Catalog(this.pdfManager, this.xref); - } - get numPages() { const linearization = this.linearization; const num = linearization ? linearization.numPages : this.catalog.numPages;