XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • AcroForm
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: