Create an annotation in AEV and add some text, followed by new lines, followed by more text.
Save and download the annotated PDF and view in adobe
notice how the new lines are gone and the text is on the same line
The issues seems to be that Adobe does not like <br /> tags and would rather it be <br></br>. We format the content of the annotation in the latter way but once line 237 of XFDFAnnotationWriterImpl.java is executed (new XMLOutputter().output(xfdfDoc, baos);), the tags are switched to <br />.
One idea tried was setting the flag to expand empty elements, xmlOutputter.setFormat(xmlOutputter.getFormat().setExpandEmptyElements(true));. This works when doing XMLOutputter().outputString but not XMLOutputter().output.
Also interesting note, passing in the content of the xfdfDoc child seems to not have the issue with the <br /> tags, but then we lose information
Steps to reproduce:
The issues seems to be that Adobe does not like
<br />
tags and would rather it be<br></br>
. We format the content of the annotation in the latter way but once line 237 ofXFDFAnnotationWriterImpl.java
is executed (new XMLOutputter().output(xfdfDoc, baos);
), the tags are switched to<br />
.One idea tried was setting the flag to expand empty elements,
xmlOutputter.setFormat(xmlOutputter.getFormat().setExpandEmptyElements(true));
. This works when doingXMLOutputter().outputString
but notXMLOutputter().output
.Also interesting note, passing in the content of the
xfdfDoc
child seems to not have the issue with the<br />
tags, but then we lose information