1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #13457 from Snuffleupagus/issue-13242

Work-around for HighlightAnnotations without a top-level /ExtGState-entry (issue 13242)
This commit is contained in:
Tim van der Meij 2021-05-28 23:38:39 +02:00 committed by GitHub
commit 5e5641b147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View file

@ -2676,7 +2676,17 @@ class HighlightAnnotation extends MarkupAnnotation {
null
));
if (quadPoints) {
if (!this.appearance) {
const resources =
this.appearance && this.appearance.dict.get("Resources");
if (!this.appearance || !(resources && resources.has("ExtGState"))) {
if (this.appearance) {
// Workaround for cases where there's no /ExtGState-entry directly
// available, e.g. when the appearance stream contains a /XObject of
// the /Form-type, since that causes the highlighting to completely
// obsure the PDF content below it (fixes issue13242.pdf).
warn("HighlightAnnotation - ignoring built-in appearance stream.");
}
// Default color is yellow in Acrobat Reader
const fillColor = this.color
? Array.from(this.color).map(c => c / 255)