Previously we were using Aspose Word 17.4 and it was working fine but due to recent upgrade to 18.7 version, we are seeing this issue. I know the latest version is 18.10, but we are trying to avoid that route. because then we have to test each and everything in our product for quality assurance purposes.
We have a process where we insert Custom XML ( that contains the data ) into the word document and then save it as a docx. As a result of a merging process, Word replaces the content controls with the XML data. Sometimes this XML data contains carriage returns/line feed. for example:
<DataParts> <DataPartText type="Text">123456 any street City, Any State, 12345</DataPartText> <DataPartText>Walter</DataPartText> </DataParts>
When we save the document as DOCX using Aspose 17.4, document.xml looks like :
<w:t>123456 any street</w:t> <w:br /> <w:br /> <w:br /> <w:t>City, Any State, 12345</w:t>
But when we save the document using Aspose 18.7, document.xml doesn’t have “BR”:
<w:t>123456 any street City, Any State, 12345</w:t>
Looks like the newer version of Aspose Word ignores the carriage return/Line feed character in the XML. Is there any work around for this ?
What is Document.xml:
Ignore this section if you already know what is document.xml. Here are the steps to get the document.xml
1- change document extension from .DOCX to .ZIP
2- Extract the ZIP file.
3- Open the folder. Goto “word”, this folder should have document.xml