diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2017-05-29 11:22:34 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2017-05-29 11:22:34 +0100 |
commit | 2e2a9d851c73192739c9227ef0030f3ba3e7b6fd (patch) | |
tree | 155ca51ff33d5d307abb255018d57bb4c57407f3 | |
parent | 3ded6c3b28a1b183a492ada2f2a3970953f3d060 (diff) | |
download | ghostpdl-2e2a9d851c73192739c9227ef0030f3ba3e7b6fd.tar.gz |
PDF interpreter - Don't render closed Popup annotations, synthesise missing Popup Appearances
Bug #697951 "MuPDF - Arguably incorrect annotation"
Although this is a MuPDF bug, it showed a couple of problems in Ghostscript
Firstly; Popup annotations which have /Open false should not be rendered
Secondly; Popup annotations with no /Open should be treated as ?open False
Finally, Popup annotations with no /Appearance were not rendered, unlike
other annotation types we were not synthesising an Appearance.
This commit addresses all 3 of these, and shows progressions with:
tests_private/pdf/PDF_1.7_FTS/fts_32_3232.pdf
tests_private/pdf/sumatra/1312_-_comments_not_displayed.pdf
tests_private/pdf/sumatra/1571_-_popup_annotations.pdf
tests_private/pdf/sumatra/embedded_go-to_actions.pdf
-rw-r--r-- | Resource/Init/pdf_draw.ps | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps index 371e638ea..5214b640b 100644 --- a/Resource/Init/pdf_draw.ps +++ b/Resource/Init/pdf_draw.ps @@ -3738,7 +3738,82 @@ currentdict /set_bc_color undef } ifelse } bdef - currentdict /quadpoints2basis undef + /Popup { + dup /Open oknown { + dup /Open get { + dup /AP oknown { + //true + }{ + gsave + newpath + 0.05 setlinewidth + dup /Parent .knownget { + oforce + } { + dup /P .knownget { + oforce + } { + dup + } ifelse + } ifelse + /C .knownget { + aload pop + }{ + 1 1 0 + }ifelse + setrgbcolor + dup /Rect get + dup aload pop + 2 index sub + exch 3 index sub exch + 4 copy + gsave 1 setgray rectfill grestore + gsave 0 setgray rectstroke grestore + 1 index /Parent .knownget { + oforce + }{ + 1 index /P .knownget { + oforce + }{ + 1 index + } ifelse + }ifelse + dup + /Contents .knownget { + gsave + 0 setgray + /Helvetica findfont 9 scalefont setfont + 2 index aload pop 3 1 roll pop pop 30 sub exch 5 add exch + moveto show + grestore + } if + exch + dup aload pop 3 -1 roll pop exch 2 index sub -15 + 4 copy rectfill + 0 setgray rectstroke + exch + /T .knownget { + gsave + 0 setgray + /Helvetica findfont 9 scalefont setfont + dup stringwidth pop + 2 index aload pop pop exch pop exch sub + exch sub 2 div 2 index aload pop 3 1 roll pop pop 11 sub 3 1 roll add exch moveto + show + grestore + } if + grestore + //false + } ifelse + } { + pop //false + }ifelse + } { + pop //false + }ifelse + } bdef + +currentdict /quadpoints2basis undef currentdict end readonly def /.PDFDrawAnnotType? |