RadioButton 필드 만들기

FormEditorExamples.createRadioButtonField(...)를 사용하여 사전 정의된 옵션이 있는 라디오 버튼 필드를 만듭니다.

라디오 버튼 필드 생성

  1. 소스 PDF를 FormEditor 파사드에 바인딩하세요.
  2. 라디오 버튼 간격, 방향 및 항목 크기를 구성하세요.
  3. 라디오 버튼 항목을 정의하세요.
  4. 기본 선택 및 직사각형을 사용하여 라디오 버튼 필드를 추가하세요.
  5. 업데이트된 문서를 저장하세요.
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();
    }
}