<div style="word-wrap:break-word; white-space:pre-wrap">
multi
line
text
</div>
The technique of substituting a quoted line break for the 0xA character works from a visual stand point, however, if I then bring up the form and try to edit the contents, the experience is less than fantastic. What happens is that placing the cursor at the end of the line and hitting backspaces results in the cursor backing up, but the characters are not replaced with whitespace. Aft6er backing up, typing new characters appears to occur on a new layer, overlaying the old characters (which are still visible). Saving the file and reloading it produces the correct results, though.If this is expected behavior, I can live with it, but it would be nice if there was a way to make it work more cleanly.
Thanks, Skip
Starting with an empty form, I can fill out both single line and multiline fields and editing of the data in either type of field works as expected. When the form is saved, the data is presented twice in the annotation file: once in plain text and once encoded in XML. In both cases, the end-of-line is represented with a literal LF (0xA).A snippet of the XML encoding looks like this:v=“1. Line 12. Line 23. Line 3”The end-of-line character when read back in is converted to a single space so we see
1. Line 1 2. Line 2 3. Line 3
Editing PDF Form in Acrobat Reader works as expected.As reported earlier, I tweaked the AnnotationHandler code to replace <LF> inside quoted strings with 
 resulting inv=“1. Line 1
2. Line 2
3. Line 3”On input, the quoted end-of-line is replaced by <LF> and the form looks the way it should. This morning, I realized, and confirmed, that according to the XML spec, “real” control characters inside quoted strings are supposed to be encoded, the way I did it in the code, and that bare line feeds inside quoted strings are replaced by spaces. I believe this needs to be fixed in the PDFTron code.When the “fixed” annotations are read back in, attempting to edit both single line and multiline data results in the cursor moving backward as the backspace key is pressed, but the backspaced characters are not visibly erased, and typing replacement characters results in the new characters being overlaid on top of the old characters. The backspaced characters are actually erased: I can backspace over three characters in the middle of a word and replace them with one character and the result is a word with 2 fewer characters. (I need to save the change and refresh the form to see this, however.) While typing this, I had an “Aha Moment.” I have been using forms created with the PDFTron Watermark. Is it possible that the Watermark is responsible for the atypical behavior???
--
You received this message because you are subscribed to a topic in the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pdfnet-webviewer/_6eM4kfKez4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pdfnet-webview...@googlegroups.com.
To post to this group, send email to pdfnet-w...@googlegroups.com.
Visit this group at http://groups.google.com/group/pdfnet-webviewer.
For more options, visit https://groups.google.com/d/optout.