Document supported field types
bengolder opened this issue · comments
Ben Golder commented
PDF Form Field types
- Textbox field
- Checkbox
- Radio Button
- List of choices (currently getting an error when filling)
- Dropdown list (currently getting an error when filling)
- Signature (not planning to support)
Ben Golder commented
#41 exposed some more details regarding the support of different field types. Here are some observations from those attempts.
Overall PDF creation tips
- Unicode seems to be fine everwhere except as a value in Checkboxes or Radio Buttons
- Custom export values seem to cause problems for multiple field types, and should probably just be avoided.
- If two fields share the same name, it causes some surprising errors. Name conflicts between fields should be avoided.
- Text styles and appearance data is not captured
- Always list their options as the export value plus
"Off"
. With no custom export value, the default options for Checkboxes are:["Off", "Yes"]
- Do not seem to be able to support Unicode as a custom export value. Can they handle Unicode in their field names?
- Unclear if it one can find out whether the field is checked by default. But there are always only two options, never a third.
- The field value is not enclosed in parenthesis in the fdf file.
- These are groups of mutually exclusive options.
- Each group of radio buttons shows up as one field.
- The list of options is always the set of choices (usually just the names of the individual buttons) plus
"Off"
. For example,['Choice1', 'Choice2', 'Choice3', 'Off']
- If two buttons in a group share the same name, indices will be added to the set of available options. The index of the selected button will be displayed as the field value in the data dump, but the fdf will show the name as the value (despite the consequent ambiguity).
- List boxes with the same name will be interpreted as one field by pdftk, and Acrobat will copy any selected choices on one into the the other.
- If export values differ from the display options, pdftk will only extract the currently selected export value.
- There doesn't seem to be any indication of whether a field supports multiple selection, but this should be tested further.
- The default choice is shown
- The selected option may not be included the list of options.
Dropdowns: "Choice"
(AKA Combo Box)
- There is no indication of whether they allow custom user input.
- Does not show display options, only the export values.
- In cases where export values differ from display options, pdftk will only extract the currently selected export value.
- Seems to do fine with unicode field names and values
- Didn't seem to have any trouble.