mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Fix Issue #4461: Pages without \Resources in their dictionary fail to load
When no "\Resource" entry could be found return an empty dictionary
This commit is contained in:
parent
ad4be03a08
commit
1ddb019449
1 changed files with 8 additions and 1 deletions
|
@ -57,7 +57,14 @@ var Page = (function PageClosure() {
|
||||||
return this.getPageProp('Contents');
|
return this.getPageProp('Contents');
|
||||||
},
|
},
|
||||||
get resources() {
|
get resources() {
|
||||||
return shadow(this, 'resources', this.inheritPageProp('Resources'));
|
var value = this.getInheritedPageProp('Resources');
|
||||||
|
// For robustness: The spec states that a \Resources entry has to be
|
||||||
|
// present, but can be empty. Some document omit it still. In this case
|
||||||
|
// return an empty dictionary:
|
||||||
|
if (value === undefined) {
|
||||||
|
value = new Dict();
|
||||||
|
}
|
||||||
|
return shadow(this, 'resources', value);
|
||||||
},
|
},
|
||||||
get mediaBox() {
|
get mediaBox() {
|
||||||
var obj = this.inheritPageProp('MediaBox');
|
var obj = this.inheritPageProp('MediaBox');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue