Ensure that the /Properties, used with optional content, is actually loaded *before* parsing the operatorList/textContent (PR 12095 follow-up)
By not waiting for the /Properties to load, before parsing of the operatorList/textContent starts, there's a very real risk that a `MissingDataException` will be thrown when trying to access the data in the `PartialEvaluator.parseMarkedContentProps` method. If this ever happens it will thus lead to incomplete and/or outright broken rendering, and with e.g. `disableAutoFetch=true` set the likelihood of this occuring would increase quite a bit. *Please note:* While I've not yet seen this error in an actual PDF document, it can happen during loading if you're unlucky enough with e.g. the structure of the PDF document and/or the download speed offered by the server.
This commit is contained in:
parent
fd82adccfa
commit
8f6543c218
@ -318,12 +318,13 @@ class Page {
|
|||||||
"getContentStream"
|
"getContentStream"
|
||||||
);
|
);
|
||||||
const resourcesPromise = this.loadResources([
|
const resourcesPromise = this.loadResources([
|
||||||
"ExtGState",
|
|
||||||
"ColorSpace",
|
"ColorSpace",
|
||||||
|
"ExtGState",
|
||||||
|
"Font",
|
||||||
"Pattern",
|
"Pattern",
|
||||||
|
"Properties",
|
||||||
"Shading",
|
"Shading",
|
||||||
"XObject",
|
"XObject",
|
||||||
"Font",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const partialEvaluator = new PartialEvaluator({
|
const partialEvaluator = new PartialEvaluator({
|
||||||
@ -425,8 +426,9 @@ class Page {
|
|||||||
);
|
);
|
||||||
const resourcesPromise = this.loadResources([
|
const resourcesPromise = this.loadResources([
|
||||||
"ExtGState",
|
"ExtGState",
|
||||||
"XObject",
|
|
||||||
"Font",
|
"Font",
|
||||||
|
"Properties",
|
||||||
|
"XObject",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
|
const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
|
||||||
|
Loading…
Reference in New Issue
Block a user