Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.8
    • Fix Version/s: 2.0.9, 3.0.0 PDFBox
    • Component/s: AcroForm
    • Labels:

      Description

      When saving an XFDF into file, all the `<value>` are skiped in the output.

      This is due to an incoherence between `writeXML()` which use `value instanceof COSString`

       public void writeXML(Writer output) throws IOException
          {
              output.write("<field name=\"" + getPartialFieldName() + "\">\n");
              Object value = getValue();
              if (value != null)
              {
                  if (value instanceof COSString)
                  {
                      output.write("<value>" + escapeXML(((COSString) value).getString()) + "</value>\n");
                  }
                  else if (value instanceof COSStream)
                  {
                      output.write("<value>" + escapeXML(((COSStream) value).toTextString()) + "</value>\n");
                  }
              }
      

      and `getValue()` which transform COSString into String :

       public Object getValue() throws IOException
          {
              COSBase value = field.getDictionaryObject(COSName.V);
              if (value instanceof COSName)
              {
                  return ((COSName) value).getName();
              }
              else if (value instanceof COSArray)
              {
                  return COSArrayList.convertCOSStringCOSArrayToList((COSArray) value);
              }
              else if (value instanceof COSString)
              {
                  return ((COSString) value).getString();
              }
      

        Attachments

          Activity

            People

            • Assignee:
              msahyoun Maruan Sahyoun
              Reporter:
              loic oudot Loic
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: