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:
commit
5e5641b147
@ -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)
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -254,6 +254,7 @@
|
||||
!find_all.pdf
|
||||
!helloworld-bad.pdf
|
||||
!zerowidthline.pdf
|
||||
!issue13242.pdf
|
||||
!js-colors.pdf
|
||||
!annotation-line-without-appearance-empty-Rect.pdf
|
||||
!issue12841_reduced.pdf
|
||||
|
BIN
test/pdfs/issue13242.pdf
Normal file
BIN
test/pdfs/issue13242.pdf
Normal file
Binary file not shown.
@ -2324,6 +2324,13 @@
|
||||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue13242",
|
||||
"file": "pdfs/issue13242.pdf",
|
||||
"md5": "ceb2da908c972087eb90e6bae240bce9",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true
|
||||
},
|
||||
{ "id": "issue7229",
|
||||
"file": "pdfs/issue7229.pdf",
|
||||
"md5": "480e51aae0ac271780e4603d1561d15e",
|
||||
|
Loading…
x
Reference in New Issue
Block a user