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

FDFField creates wrong object type, when loaded from XML

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: AcroForm
    • Labels:
      None

      Description

      When a FDFDocument is loaded from file with

      FDFDocument fdfDocument = FDFDocument.loadXFDF(is)
      

      and afterwards the same documet is saved via

      fdfDocument.saveXFDF(...)
      

      the output document contains only empty fields. The problem is that

      FDFField(Element fieldXML)
      

      creates with "setValue" not a "COSString", what is expected by "getValue", when saving the document.

      FDFField should use

      setValue(new COSString(XMLUtil.getNodeValue(child)));
      

      to create correct values for the XML nodes. Otherwise the import of FDF documents via e.g.

      pdAcroForm.importFDF
      

      does not work correct.

      Patch for 2.0.3 is attached.

        Attachments

        1. FDF_Import.patch
          0.8 kB
          Bernd Engelhardt

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                softvision Bernd Engelhardt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: