Merge pull request #6485 from Snuffleupagus/Dict-getArray-getAsyncArray
Prevent `PartialEvaluator_buildFormXObject` from failing if the `Matrix` or `BBox` contains indirect objects
This commit is contained in:
commit
a6761a52cc
@ -126,8 +126,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
xobj, smask,
|
xobj, smask,
|
||||||
operatorList,
|
operatorList,
|
||||||
initialState) {
|
initialState) {
|
||||||
var matrix = xobj.dict.get('Matrix');
|
var matrix = xobj.dict.getArray('Matrix');
|
||||||
var bbox = xobj.dict.get('BBox');
|
var bbox = xobj.dict.getArray('BBox');
|
||||||
var group = xobj.dict.get('Group');
|
var group = xobj.dict.get('Group');
|
||||||
if (group) {
|
if (group) {
|
||||||
var groupOptions = {
|
var groupOptions = {
|
||||||
|
@ -135,6 +135,22 @@ var Dict = (function DictClosure() {
|
|||||||
return Promise.resolve(value);
|
return Promise.resolve(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Same as get(), but dereferences all elements if the result is an Array.
|
||||||
|
getArray: function Dict_getArray(key1, key2, key3) {
|
||||||
|
var value = this.get(key1, key2, key3);
|
||||||
|
if (!isArray(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
value = value.slice(); // Ensure that we don't modify the Dict data.
|
||||||
|
for (var i = 0, ii = value.length; i < ii; i++) {
|
||||||
|
if (!isRef(value[i])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
value[i] = this.xref.fetch(value[i]);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
|
||||||
// no dereferencing
|
// no dereferencing
|
||||||
getRaw: function Dict_getRaw(key) {
|
getRaw: function Dict_getRaw(key) {
|
||||||
return this.map[key];
|
return this.map[key];
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
!tracemonkey.pdf
|
!tracemonkey.pdf
|
||||||
!franz.pdf
|
!franz.pdf
|
||||||
|
!franz_2.pdf
|
||||||
!issue2391-1.pdf
|
!issue2391-1.pdf
|
||||||
!issue2391-2.pdf
|
!issue2391-2.pdf
|
||||||
!issue5801.pdf
|
!issue5801.pdf
|
||||||
|
BIN
test/pdfs/franz_2.pdf
Normal file
BIN
test/pdfs/franz_2.pdf
Normal file
Binary file not shown.
@ -527,6 +527,14 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"about": "Type1 font with |Ref|s in the Differences array of the Encoding dictionary."
|
"about": "Type1 font with |Ref|s in the Differences array of the Encoding dictionary."
|
||||||
},
|
},
|
||||||
|
{ "id": "franz_2",
|
||||||
|
"file": "pdfs/franz_2.pdf",
|
||||||
|
"md5": "9d301ed8816e879891115b5cc3c39559",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"about": "XObject with BBox array containing indirect object."
|
||||||
|
},
|
||||||
{ "id": "issue4934",
|
{ "id": "issue4934",
|
||||||
"file": "pdfs/issue4934.pdf",
|
"file": "pdfs/issue4934.pdf",
|
||||||
"md5": "6099da44f677702ae65a648b51a2226d",
|
"md5": "6099da44f677702ae65a648b51a2226d",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user