Skip to content

Commit 6318ccf

Browse files
committed
Treat all content as visible when no optional content groups are defined (issue 13971)
In the referenced PDF document the /Contents stream contains MarkedContent-operators, however no optional content dictionary exists; according to [the specification](https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G7.3883825): > Null values or references to deleted objects shall be ignored. If this entry is not present, is an empty array, or contains references only to null or deleted objects, the membership dictionary shall have no effect on the visibility of any content.
1 parent da15dbf commit 6318ccf

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/display/optional_content_config.js

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ class OptionalContentConfig {
9595
}
9696

9797
isVisible(group) {
98+
if (this._groups.size === 0) {
99+
return true;
100+
}
98101
if (!group) {
99102
warn("Optional content group not defined.");
100103
return true;

test/pdfs/issue13971.pdf.link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mozilla/pdf.js/files/7109095/PDFBOX-5275-p5.pdf

test/test_manifest.json

+7
Original file line numberDiff line numberDiff line change
@@ -3728,6 +3728,13 @@
37283728
"link": true,
37293729
"type": "eq"
37303730
},
3731+
{ "id": "issue13971",
3732+
"file": "pdfs/issue13971.pdf",
3733+
"md5": "50fbf6b9f26ea0e4427f33bae62a4d77",
3734+
"rounds": 1,
3735+
"link": true,
3736+
"type": "eq"
3737+
},
37313738
{ "id": "issue1655",
37323739
"file": "pdfs/issue1655r.pdf",
37333740
"md5": "569f48449ba57c15c4f9ade151a651c5",

0 commit comments

Comments
 (0)