Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3479

NPE in AppearanceGeneratorHelper.setAppearanceValue() if no rectangle in widget

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2, 2.0.3, 3.0.0 PDFBox
    • 2.0.3, 3.0.0 PDFBox
    • AcroForm
    • None

    Description

      As reported in the linked stackoveflow question, can be reproduced with the CreateSimpleForm example by removing the widget.setRectangle(rect);.

      java.lang.NullPointerException
      at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:137)
      at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:263)
      at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:225)
      at org.apache.pdfbox.pdmodel.interactive.form.PDTextField.setValue(PDTextField.java:218)
      

      I'll throw an IOException.

      Attachments

        1. SimpleForm.pdf
          1 kB
          Tilman Hausherr
        2. SimpleForm2.pdf
          5 kB
          Tilman Hausherr
        3. SimpleFormNoRect.Acrobat.pdf
          5 kB
          Maruan Sahyoun
        4. SimpleFormNoRect.pdf
          0.9 kB
          Maruan Sahyoun

        Activity

          People

            msahyoun Maruan Sahyoun
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: