Skip navigation
vaclav123
Currently Being Moderated

incorrect checkbox appearance

Mar 19, 2013 2:40 AM

Tags: #acroform #checkbox #appearance_streams

Hello everyone,

 

I'm working on a program that generates interactive forms in PDF. I'd like to add a checkbox on the page but there is problem. When the checbox has focus, everything works ok. When the focus is out, the checbox loses its appearance and it is rendered in default graphics (that's incorrect for me).

 

You can see the problem here: http://home.zcu.cz/~struharv/000003-checkbox.pdf (it's a handmade pdf file to be easily readable). In chrome build-in viewer it works ok, but not in Acrobat.

 

 

I don't see what's wrong.

Thanks for your help.

 

 

%PDF-1.7


1 0 obj << % entry point
          /Type /Catalog
          /AcroForm << 
                    /DR 3 0 R
                    /Fields [101 0 R]
          >>
          /Pages 2 0 R
>>
endobj


2 0 obj <<   % Pages object
          /Type /Pages
          /MediaBox [0 0 200 200]
          /Count 1
          /Kids [ 
                    <<       % Page
                              /Type /Page
                              /Parent 2 0 R
                              /Resources 3 0 R
                              /Annots [101 0 R]
                              /Contents 5 0 R
                    >>
          ]
>>
endobj


101 0 obj <<
          /Type /Annot
          /Subtype /Widget
          /Rect [70 50 120 70]
          /AP <<
                    /N << /Yes 108 0 R /Off 109 0 R >>
          >>
          /AS /Yes
          /V /Yes
          /FT /Btn
          /T (checkbox1) 
>>
endobj


108 0 obj <<      
    /Type /XObject
          /Subtype /Form
          /BBox [0 0 50 20]
          /Resources 3 0 R
>>
stream
          0 0 50 20 re
          0.8 g
          f
          BT
                    /F1 12 Tf
                    0 g
                    7 5.908 Td
                    (checked) Tj
          ET
endstream
endobj


109 0 obj << 
          /Type /XObject
          /Subtype /Form
          /BBox [0 0 50 20]
          /Resources 3 0 R
>>
stream
          0 0 50 20 re
          0.6 g
          B
          BT
                    /F1 12 Tf
                    0 g
                    7 5.908 Td
                    (unchecked) Tj
          ET
endstream
endobj

3 0 obj <<      % Resources
    /Font <<
                    /F1 4 0 R
          >>
>>
endobj


4 0 obj <<      % Font
          /Type /Font
          /Subtype /Type1
          /BaseFont /Times-Roman
>>
endobj


5 0 obj << % page content
>>
stream
          BT
                    70 150 TD
                    /F1 12 Tf
                    (Hello, world!) Tj
          ET
endstream
endobj


trailer 
<<
  /Root 1 0 R
>>
%%EOF

 
Replies
  • Currently Being Moderated
    Mar 19, 2013 3:14 AM   in reply to vaclav123

    Depending on how you look at this – it's either a bug or a feature…

     

    Acrobat/Reader have a feature (been there since Acrobat/Reader 6, IIRC) where they will "Highlight form fields" to show users which things on the page are real fields and which are simply text.  This is on by default, though can be turned off in Preferences.  Additionally, when the Form Message Bar (the purple thing) is present on a more complex form (than your one check box), the user can toggle it on/off easily.

     

    The highlight feature doesn't respect custom appearances, which is why you are seeing the normal one until you click.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2013 5:15 AM   in reply to vaclav123

    They don't use custom appearances

     
    |
    Mark as:
  • George Johnson
    11,671 posts
    Aug 11, 2002
    Currently Being Moderated
    Mar 19, 2013 11:08 AM   in reply to lrosenth

    This is becoming more of an issue now that InDesign allows you to create custom appearances for various types of fields, and it's not just related to field highlighting.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points