tsgrp / OpenAnnotate

TSG's Browser-based Annotation Tool
8 stars 4 forks source link

Annotations With New Lines Do Not Display New Lines in Adobe #923

Closed newmanju closed 2 years ago

newmanju commented 3 years ago

Steps to reproduce:

  1. Create an annotation in AEV and add some text, followed by new lines, followed by more text.
  2. Save and download the annotated PDF and view in adobe
  3. 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

gsteimer commented 2 years ago

Moved to Jira: https://alfresco.atlassian.net/browse/SEP-89