Hi,
We are using ASPOSE.WORD apis to convert HTML into DOCX document.
When I open the converted document from Office word, it looks good. But when i open the same docx document from word web part, i lost the spacing between paragraph.
Please see the attached output document(Output document.docx). When we open this from word web part, the output looks like the attached screenshot(Web part screenshot.PNG).
Sample code which i am using for conversion
InputStream is = xml.getInputStream();
// Load the document.
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.HTML);
// Open the workbook
Document convDoc = new Document(is, loadOptions);
// Create a new memory stream.
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
// Save the document to stream.
convDoc.save(outStream, SaveFormat.DOC);
Document newDoc = new Document(new ByteArrayInputStream(outStream.toByteArray()));
ByteArrayOutputStream newOutStream = new ByteArrayOutputStream();
newDoc.save(newOutStream, SaveFormat.DOCX);
I am attaching following files
Input html file : Input Html document.zip
Output word document: Output document.docx
Screenshot of word web part: Web part screenshot.png
Thanks in advance for your help.