Add support for specifying non-default Optional Content in the ref-tests

This commit is contained in:
Jonas Jenwald 2021-08-24 11:48:54 +02:00
parent 853b1172a1
commit 1a1de9bb3e
2 changed files with 19 additions and 1 deletions

View File

@ -519,7 +519,7 @@ var Driver = (function DriverClosure() {
styleElement: xfaStyleElement,
});
loadingTask.promise.then(
doc => {
async doc => {
if (task.enableXfa) {
task.fontRules = "";
for (const rule of xfaStyleElement.sheet.cssRules) {
@ -531,6 +531,15 @@ var Driver = (function DriverClosure() {
task.optionalContentConfigPromise =
doc.getOptionalContentConfig();
if (task.optionalContent) {
const entries = Object.entries(task.optionalContent),
optionalContentConfig =
await task.optionalContentConfigPromise;
for (const [id, visible] of entries) {
optionalContentConfig.setVisibility(id, visible);
}
}
this._nextPage(task, failure);
},
err => {

View File

@ -5025,6 +5025,15 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue13931-hidden",
"file": "pdfs/issue13931.pdf",
"md5": "799d5025787115d22863ae23a3042491",
"rounds": 1,
"type": "eq",
"optionalContent": {
"7R": false
}
},
{ "id": "issue2829",
"file": "pdfs/issue2829.pdf",
"md5": "f32b28cf8792f6ccc470446bfbb38584",