Question

I'm working on a program generating interactive forms into PDF files.

The generated file is here (source is readable). The checkbox is on the bottom of the page. After it gets focus it is rendered correctly (white square with red/blue border), after it lose the focus the square disappears and the default appereance is shown (thats incorrect for me).

  • in Acrobat 9, X, XI
  • in build-in chrome pdf viewer it works fine
  • Adobe XI Pro - preflight - shows warning "Form field has multiple appearances"

I can not find the mistake.

Thanks for your help.

the same (similar) problem described there: http://forums.adobe.com/message/5144579#5144579

---- here is a part of a pdf file I expect the mistake

2 0 obj
<<
  /Type /Catalog
  /Pages 1 0 R
  /OutputIntents [7 0 R]
  /Metadata 8 0 R
  /PageLabels 10 0 R
  /AcroForm 14 0 R
>>

endobj

14 0 obj
<< 
  /Fields [13 0 R] 
>>
endobj

13 0 obj
<<
  /Type /Annot
  /Subtype /Widget
  /Rect [20.0 20.0 120.0 120.0]
  /FT /Btn
  /F 4
  /T (name)
  /AS /Yes
  /V /Yes
  /AP << 
        /N <<
             /Yes 11 0 R
             /Off 12 0 R >>
   >>
>>
endobj


11 0 obj
<<
  /Type /XObject
  /SubType /Form
  /BBox [20.0 20.0 120.0 120.0]
  /Length 19 0 R
>>
stream
  ....
endstream
endobj

12 0 obj
<<
  /Type /XObject
  /SubType /Form
  /BBox [20.0 20.0 120.0 120.0]
  /Length 20 0 R
>>
stream
  ....
endstream
endobj
Was it helpful?

Solution

My observations with your PDF are somewhat different but interesting nonetheless:

  • Adobe Acrobat 9 Pro v9.5.4 (with PDF/A r/o view disabled) here does exactly what you originally seem to have expected: It only uses the red or blue framed box. If one toggled the check box, though, even if toggling back on again, it wants to save a new revision with some changes to your field.

  • Adobe Reader X! v11.0.2 starts in PDF/A read-only mode and displays the red frame. After leaving that r/o mode, though, it shows the default cross appearance. When it gets the focus it again uses the red and blued frames. When it loses focus, it goes back to the default appearances.

The behavior I observed in Adobe Reader X! seems to be what you observed in more cases.

Thus in essence the issue is that under certain circumstances (for me: not in PDF/A r/o mode, focus not on form field) some PDF vewers (for me: Adobe Reader XI) don't use your custom check box appearances but some standard ones, and you think that this is incorrect.

Unfortunately there is a hint in the PDF specification ISO 32000-1:2008 according to which viewers may (perhaps even shall) act just so. Table 189 in section 12.5.6.19 Widget Annotations explains the entries in an appearance characteristics dictionary (value of /MK in the widget dictionary; you do not provide one, thus defaults apply), among them /CA:

text string (Optional; button fields only) The widget annotation’s normal caption, which shall be displayed when it is not interacting with the user.

Unlike the remaining entries listed in this Table, which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, “Button Fields”), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, “Button Fields”) and radio buttons (Radio Buttons in 12.7.4.2, “Button Fields”).

In particular check boxes, therefore, whenever not interacting with the user, shall be displayed using their normal captions, not their appearances.

When there is no focus on a form field, Adobe Reader seems to think that the form is not interacting with the user, and therefore switches to display of caption instead of appearance.

Unfortunately the normal caption you can define for a button is but a text string which by default seems to be interpreted in the context of the Zapf Dingbats font (try /MK<</CA(1)>> for example). This is, though, where you should continue looking, maybe you can make it use some Type 3 font of your design containing a blue and a red square frame.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top