How to add button with "icon only" layout to pdf using PDFBOX?

Viewed 49
1 Answers

The desired layout information may be stored in the TP entry of the appearance characteristics dictionary:

Key Type Value
TP integer (Optional; pushbutton fields only) A code indicating where to position the text of the widget annotation’s caption relative to its icon:
0 No icon; caption only
1 No caption; icon only
2 Caption below the icon
3 Caption above the icon
4 Caption to the right of the icon
5 Caption to the left of the icon
6 Caption overlaid directly on the icon
Default value: 0.

(ISO 32000-1, Table 189 – Entries in an appearance characteristics dictionary)

Thus, you may want to try setting the TP entry of the PDAppearanceCharacteristicsDictionary fieldAppearance in the referenced code to 1.

Related