Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.8
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(); }