My application takes documents with text placeholders, fills them in, converts them to PDF, and returns them to the user. In this application, Gembox only handles the conversion step, as the placeholder work was done prior to bringing it in.
For multi-line placeholders, a placeholder such as {Recipient Address} would initially look like this:
<w:t>{Recipient Address}</w:t>
and it is replaced with the following lines of XML:
<w:t>
<w:t>AddressLine1</w:t>
<w:br/>
<w:t>AddressLine2</w:t>
<w:br/>
<w:t>Country</w:t>
<w:br/>
<w:t>Zip/Post Code</w:t>
<w:br/>
</w:t>
When this is converted to a PDF (standard doc.Save()
into a MemoryStream
with SaveOptions.PdfDefault
), these lines will disappear. This does not happen when converting inside MS Word.
If we use the following XML instead:
<w:t>AddressLine1<w:br/>AddressLine2<w:br/>Country<w:br/>Zip/Post Code<w:br/></w:t>
We retain “AddressLine1” but not the other lines.
Any advice on how to stop this from occurring?