Inline the setup
method in the parse
method in src/core/document.js
Now that the `parse` method is simplified we can inline the `setup` method in the `parse` method since it's only two lines of code. This avoids some indirection.
This commit is contained in:
parent
280207c740
commit
0f229d537f
@ -573,7 +573,8 @@ class PDFDocument {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parse(recoveryMode) {
|
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
|
// The `checkHeader` method is called before this method and parses the
|
||||||
// version from the header. The specification states in section 7.5.2
|
// version from the header. The specification states in section 7.5.2
|
||||||
@ -676,11 +677,6 @@ class PDFDocument {
|
|||||||
this.xref.setStartXRef(this.startXRef);
|
this.xref.setStartXRef(this.startXRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(recoveryMode) {
|
|
||||||
this.xref.parse(recoveryMode);
|
|
||||||
this.catalog = new Catalog(this.pdfManager, this.xref);
|
|
||||||
}
|
|
||||||
|
|
||||||
get numPages() {
|
get numPages() {
|
||||||
const linearization = this.linearization;
|
const linearization = this.linearization;
|
||||||
const num = linearization ? linearization.numPages : this.catalog.numPages;
|
const num = linearization ? linearization.numPages : this.catalog.numPages;
|
||||||
|
Loading…
Reference in New Issue
Block a user