mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #13932 from Snuffleupagus/oc-images
Support Optional Content in Image-/XObjects (issue 13931)
This commit is contained in:
commit
306119b12a
5 changed files with 58 additions and 9 deletions
|
@ -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 => {
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -442,6 +442,7 @@
|
|||
!issue8097_reduced.pdf
|
||||
!quadpoints.pdf
|
||||
!transparent.pdf
|
||||
!issue13931.pdf
|
||||
!xobject-image.pdf
|
||||
!issue6605.pdf
|
||||
!ccitt_EndOfBlock_false.pdf
|
||||
|
|
BIN
test/pdfs/issue13931.pdf
Normal file
BIN
test/pdfs/issue13931.pdf
Normal file
Binary file not shown.
|
@ -5019,6 +5019,21 @@
|
|||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue13931-default",
|
||||
"file": "pdfs/issue13931.pdf",
|
||||
"md5": "799d5025787115d22863ae23a3042491",
|
||||
"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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue