XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: AcroForm
    • Labels:
      None

      Description

      This code

      PDField newField = tplDoc.getDocumentCatalog().getAcroForm().getField("01.20.Entry1");
      PDCheckbox newCheckBoxField = (PDCheckbox) newField;
      newCheckBoxField.check();
      

      brings this exception:

      Exception in thread "main" java.lang.UnsupportedOperationException: not implemented
      	at org.apache.pdfbox.pdmodel.interactive.form.PDButton.constructAppearances(PDButton.java:225)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:220)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDCheckbox.setValue(PDCheckbox.java:128)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDCheckbox.check(PDCheckbox.java:71)
      

      what did work is this:

      newCheckBoxField.getCOSObject().setItem(COSName.V, vValue);
      newCheckBoxField.getCOSObject().setItem(COSName.AS, asValue);
      

        Attachments

        1. TestTemplate.pdf
          126 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: