summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2020-10-13 08:16:11 -0700
committerRay Johnston <ray.johnston@artifex.com>2020-10-23 09:09:17 -0700
commit81ed663a4a81a265afecbc7b7c7835ba4f5f24e1 (patch)
tree9aa6b4d67d2ec02b31b9cd1971dab26d0c8bc66b
parent8313e4f30bef7c50711cd503c3037184a7850d51 (diff)
downloadghostpdl-81ed663a4a81a265afecbc7b7c7835ba4f5f24e1.tar.gz
Change default ShowAcroForm to true to match Adobe Acrobat.
Change it and the documentation. It may be that older Acrobat defaulted to ignoring AcroForm, but current Adobe doesn't. Also fix pdf_draw draw_form_field to match check in pdf_main process_trailer_attrs for the file from Bug 692447 which has null entries in Fields array. Fix indentation in pdf_main process_trailer_attrs area that processes AcroForm dict.
-rw-r--r--Resource/Init/pdf_draw.ps27
-rw-r--r--Resource/Init/pdf_main.ps43
-rw-r--r--doc/Use.htm9
3 files changed, 41 insertions, 38 deletions
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index 2bab06439..f22acea2f 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -5712,22 +5712,25 @@ currentdict end def
% The recursive enumeration of the form fields doesn't descend into widget annotations.
/draw_form_field { % <field> draw_form_field -
- dup /Kids knownoget { % field []
- dup length 0 gt {
- dup 0 oget /Parent knownoget { % field [] kid
- pop % mon-terminal field % field []
- exch pop % []
- { oforce draw_form_field } forall
+ dup type /dicttyype eq { % File for Bug692447 has 'null' Fields entries
+ % This matches what pdf_main process_trailer_attrs
+ dup /Kids knownoget { % field []
+ dup length 0 gt {
+ dup 0 oget /Parent knownoget { % field [] kid
+ pop % mon-terminal field % field []
+ exch pop % []
+ { oforce draw_form_field } forall
+ } {
+ pop draw_terminal_field % separate annots % -
+ } ifelse
} {
- pop draw_terminal_field % separate annots % -
+ ( **** Error: Ignoring empty /Kids array in Form field.\n) pdfformaterror
+ ( Output may be incorrect.\n) pdfformaterror
} ifelse
} {
- ( **** Error: Ignoring empty /Kids array in Form field.\n) pdfformaterror
- ( Output may be incorrect.\n) pdfformaterror
+ draw_terminal_field % merged annotation % -
} ifelse
- } {
- draw_terminal_field % merged annotation % -
- } ifelse
+ } if
} bind executeonly def
/draw_acro_form { % <form> draw_acro_form -
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index 091007a56..e86115aa4 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -1270,26 +1270,26 @@ currentdict /xref-char-dict undef
% to the parent field.
Trailer /Root knownoget {
/AcroForm knownoget {
- %% If we don't have a NeedAppearances entry, treat as if true.
- %% We know Acrobat always regenerates all annotait
- dup /NeedAppearances knownoget not { //true } if {
- /NeedAppearances //true def
- dup
- /Fields knownoget {
- { oforce
- %% Make sure the entry from the Fields array is a dictionary
- %% Bug #692447.pdf has an array of nulls.
- dup type /dicttype eq {
- link_widget_annots
- }if
- pop
- } forall
- } if
- pop
- } {
- pop
- } ifelse
- } if
+ %% If we don't have a NeedAppearances entry, treat as if true.
+ %% We know Acrobat always regenerates all annotations.
+ dup /NeedAppearances knownoget not { //true } if {
+ /NeedAppearances //true def
+ dup
+ /Fields knownoget {
+ { oforce
+ %% Make sure the entry from the Fields array is a dictionary
+ %% Bug #692447.pdf has an array of nulls.
+ dup type /dicttype eq {
+ link_widget_annots
+ }if
+ pop
+ } forall
+ } if
+ pop
+ } {
+ pop
+ } ifelse
+ } if
} if
% Use OutputIntent ICC profile
@@ -2984,7 +2984,8 @@ currentdict /PDF2PS_matrix_key undef
} ifelse
} if
} if
- //systemdict /ShowAcroForm .knownget { //true eq } { //false } ifelse {
+ % default AcroForm to true to match Acrobat.
+ //systemdict /ShowAcroForm .knownget { //true eq } { //true } ifelse {
Trailer /Root oget /AcroForm knownoget { draw_acro_form } if
} if
} bind executeonly def
diff --git a/doc/Use.htm b/doc/Use.htm
index e317cb63f..1acde06c3 100644
--- a/doc/Use.htm
+++ b/doc/Use.htm
@@ -712,12 +712,11 @@ be drawn, whilst those not listed will not be drawn.</p>
</dl>
<dl>
- <dt><code>-dShowAcroForm</code></dt>
+ <dt><code>-dShowAcroForm=false</code></dt>
<dd>
- Show annotations referred from the Interactive Form Dictionary (AcroForm dictionary).
- By default, AcroForm is not enumerated because Adobe Acrobat doesn't do this.
- This option may be useful for debugging or recovery of incorrect PDF files
- that don't associate all annotations with the page objects.</dd>
+ Don't show annotations from the Interactive Form Dictionary (AcroForm dictionary).
+ By default, AcroForm processing is now enabled because Adobe Acrobat does this. This option
+ is provided to restore the previous behavior which corresponded to older Acrobat.</dd>
</dl>
<dl>