Prevent breaking errors when an optional content group is undefined (issue 13851)
In the referenced PDF document *most* of the form `/Form` XObjects don't have an `/OC` entry, which thus causes the runtime failure during rendering.
This commit is contained in:
parent
d5302315ce
commit
d5e14d3dc3
@ -95,6 +95,10 @@ class OptionalContentConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isVisible(group) {
|
isVisible(group) {
|
||||||
|
if (!group) {
|
||||||
|
warn("Optional content group not defined.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (group.type === "OCG") {
|
if (group.type === "OCG") {
|
||||||
if (!this._groups.has(group.id)) {
|
if (!this._groups.has(group.id)) {
|
||||||
warn(`Optional content group not found: ${group.id}`);
|
warn(`Optional content group not found: ${group.id}`);
|
||||||
|
1
test/pdfs/issue13851.pdf.link
Normal file
1
test/pdfs/issue13851.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/mozilla/pdf.js/files/6896539/doc_image.pdf
|
@ -3688,6 +3688,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue13851",
|
||||||
|
"file": "pdfs/issue13851.pdf",
|
||||||
|
"md5": "d933d397c4efc80faba856bf8deafc1a",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue1655",
|
{ "id": "issue1655",
|
||||||
"file": "pdfs/issue1655r.pdf",
|
"file": "pdfs/issue1655r.pdf",
|
||||||
"md5": "569f48449ba57c15c4f9ade151a651c5",
|
"md5": "569f48449ba57c15c4f9ade151a651c5",
|
||||||
|
Loading…
Reference in New Issue
Block a user