RadioButton フィールドの作成
Contents
[
Hide
]
FormEditorExamples.createRadioButtonField(...) を使用して、事前に定義されたオプションを持つラジオボタンフィールドを作成してください。
ラジオボタンフィールドの作成
- ソース PDF を
FormEditorファサードにバインドしてください。 - ラジオボタンの間隔、向き、および項目サイズを設定してください。
- ラジオボタン項目を定義してください。
- デフォルト選択と矩形を持つラジオボタンフィールドを追加してください。
- 更新されたドキュメントを保存してください。
public static void createRadioButtonField(Path inputFile, Path outputFile) {
FormEditor editor = new FormEditor();
try {
editor.bindPdf(inputFile.toString());
editor.setRadioGap(4);
editor.setRadioHoriz(false);
editor.setRadioButtonItemSize(20);
editor.setItems(new String[] {"Australia", "New Zealand", "Malaysia"});
editor.addField(FieldType.Radio, "radiobutton1", "Malaysia", 1, 240, 498, 256, 514);
editor.save(outputFile.toString());
} finally {
editor.close();
}
}