Skip to content

Commit 1cdb5e6

Browse files
committed
Add support for specifying non-default Optional Content in the ref-tests
1 parent 0bd8f91 commit 1cdb5e6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/driver.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ var Driver = (function DriverClosure() {
519519
styleElement: xfaStyleElement,
520520
});
521521
loadingTask.promise.then(
522-
doc => {
522+
async doc => {
523523
if (task.enableXfa) {
524524
task.fontRules = "";
525525
for (const rule of xfaStyleElement.sheet.cssRules) {
@@ -531,6 +531,15 @@ var Driver = (function DriverClosure() {
531531
task.optionalContentConfigPromise =
532532
doc.getOptionalContentConfig();
533533

534+
if (task.optionalContent) {
535+
const entries = Object.entries(task.optionalContent),
536+
optionalContentConfig =
537+
await task.optionalContentConfigPromise;
538+
for (const [id, visible] of entries) {
539+
optionalContentConfig.setVisibility(id, visible);
540+
}
541+
}
542+
534543
this._nextPage(task, failure);
535544
},
536545
err => {

test/test_manifest.json

+9
Original file line numberDiff line numberDiff line change
@@ -5025,6 +5025,15 @@
50255025
"rounds": 1,
50265026
"type": "eq"
50275027
},
5028+
{ "id": "issue13931-hidden",
5029+
"file": "pdfs/issue13931.pdf",
5030+
"md5": "799d5025787115d22863ae23a3042491",
5031+
"rounds": 1,
5032+
"type": "eq",
5033+
"optionalContent": {
5034+
"7R": false
5035+
}
5036+
},
50285037
{ "id": "issue2829",
50295038
"file": "pdfs/issue2829.pdf",
50305039
"md5": "f32b28cf8792f6ccc470446bfbb38584",

0 commit comments

Comments
 (0)