Skip to content

PDF reference What you should know about PDF

tcocca edited this page Jun 10, 2011 · 3 revisions

PDF files are annoying... right ?
What is more annoting than PDF files ? the PDF reference of course !

Because, you will need it someday, we put you a link to get the material quickly (Don't loose time in googling, when you'll need hours to understand how to read is this damn flag !)

go here : http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf

Everything is well explained, but you will seek in 1236 pages !

But first of all, check our abstract, maybe the information you need is here (no need to thanks !)

How a form is written in a PDF ?

it isn't, only fields are written...

[1 file = X fields = 1 form]

What are the fields types allowed ?

Section 8.6.3 tell us, there are only 4 kinds of fields :

  • Button Fields (including : push button, radio button, check boxes)
  • Text Fields (including : Password, Textarea, comb, RichText, FileSelect)
  • Choice Fields (including : Combo, MultiSelect, Edit)
  • Signature Fields (not available in our context)

See fields type equivalence here < not written yet >

What options can be assigned to a field ?

Here a quick (but summarized) copy/paste

All Fields:

    1. ReadOnly - If set the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database.
    1. Required - If set the field must have a value at the time it is exported by a submit-form action.
    1. NoExport - If set the field must not be exported by a submit-form action.

Text Fields Only:

    1. Multiline - If set the field can contain multiple lines of text; if clear, the field’s text is restricted to a single line.
    1. Password - If set the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters. To protect password confidentiality, viewer applications should never store the value of the text field in the PDF file if this flag is set.
    1. FileSelect (PDF 1.4) - If set the text entered in the field represents the pathname of a file whose contents are to be submitted as the value of the field.
    1. DoNotSpellCheck (PDF 1.4) - This flag is meaningful only if the Combo and Edit flags are both set. If set text entered in the field is not spell-checked.
    1. DoNotScroll (PDF 1.4) - If set the field does not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text is accepted.
    1. Comb (PDF 1.5) - Meaningful only if the MaxLen entry is present in the text field and if the Multiline, Password, and FileSelect flags are clear. If set the field is automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.
    1. RichTex (PDF 1.5) - If set the value of this field should be represented as a rich text string. If the field has a value, the entry of the field dictionary specifies the rich text string.

Choice Fields Only:

    1. Combo - If set the field is a combo box; if clear, the field is a list box.
    1. Edit - This flag is meaningful only if the Combo flag is set. If set the combo box includes an editable text box as well as a drop down list; if clear, it includes only a drop down list.
    1. Sort - If set the field’s option items should be sorted alphabetically. This flag is intended for use by form authoring tools, not by PDF viewer applications; viewers should simply display the options in the order in which they occur in the Opt array.
    1. MultiSelect (PDF 1.4) - If set more than one of the field’s option items may be selected simultaneously; if clear, no more than one item at a time may be selected.
    1. CommitOnSelChange (PDF 1.5) - If set the new value is committed as soon as a selection is made with the pointing device. This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.

Button Fields Only:

    1. Radio - This flag is meaningful only if the Pushbutton flag is clear. If set the field is a set of radio buttons; if clear, the field is a checkbox.
    1. Pushbutton - If set, the field is a pushbutton that does not retain a permanent value.

Radio Buttons Only:

    1. NoToggleToOff - If set exactly one radio button must be selected at all times; clicking the currently selected button has no effect. If set, clicking the selected button deselects it, leaving no button selected.
    1. RadiosInUnison (PDF 1.5) - If set a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons).

NOTE: I know there is no logic in the numbers, but they refer to a bit position in the FieldFlag attribute.

NOTE2: Look at bit position 26, both text field and radio buttons use this same bit for different purposes, not sure why, this is the only bit position that is shared by any fields.

What else ?

Don't find your information ? Go and dig deeper in the 1236 pages, and if you think this info could be useful to anyone, come back and write a little paragraph here !

http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf