Skip to content

Commit

Permalink
Don't display annotations with a PMD (barcode stuff) entry (bug 1899804)
Browse files Browse the repository at this point in the history
There's no specification for that (even if it's possible to have an idea from
the xfa specs) so we just want to hide them in order to avoid to display something
wrong.
  • Loading branch information
calixteman committed Jun 10, 2024
1 parent bb73d2a commit 2ccab97
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,12 @@ class Annotation {
this._streams.push(this.appearance);
}

if (dict.has("PMD")) {
// It's used to display a barcode but it isn't specified so we just hide
// it to avoid any confusion.
this.flags |= AnnotationFlag.HIDDEN;
}

// The annotation cannot be changed (neither its position/visibility nor its
// contents), hence we can just display its appearance and don't generate
// a HTML element for it.
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/bug1899804.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9406437
17 changes: 17 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10064,5 +10064,22 @@
"rounds": 1,
"link": true,
"type": "eq"
},
{
"id": "bug1899804_print",
"file": "pdfs/bug1899804.pdf",
"md5": "53d82575d6d5d314404ede8970073e1b",
"rounds": 1,
"link": true,
"type": "eq",
"print": true
},
{
"id": "bug1899804",
"file": "pdfs/bug1899804.pdf",
"md5": "53d82575d6d5d314404ede8970073e1b",
"rounds": 1,
"link": true,
"type": "eq"
}
]

0 comments on commit 2ccab97

Please sign in to comment.