Problem when inserting HTML into frame of Word document

Hi everyone,

I got a problem when inserting HTML into a frame of a Word document. Whenever my inserted HTML contains one or multiple paragraphs it seems to destroy the frame in the resulting pdf. Please see my attached example docx and the output pdfs for further clarification (pos1.pdf just uses a break and works fine, pos2.pdf uses paragraphs and destroys the layout).
Code sample used to produce the output:

Document doc = new Document("C:/test/pos.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
for (Bookmark b : doc.getRange().getBookmarks())
    builder.insertHtml("Para1<br />Para2"); // pos1.pdf
    builder.insertHtml("<p>Para1</p><p>Para2</p>"); // pos2.pdf

Is this a bug in Aspose.Words or am I doing anything wrong here?

Thanks in advance,

Hi Kevin,
While using the latest version of Aspose.Words for java i.e. 11.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system as WORDSNET-6475. Your request has also been linked to this issue and you will be notified as soon as it is resolved.
Sorry for the inconvenience.
Best Regards,

Hi Tilal,

thanks for looking into this.

Further update on this problem: The same thing seems to happen when inserting a table or a list (ul/ol) into a frame via insertHtml.

Hope you can get this resolved in a future version.


Hi Kevin,
Thanks for the additional information. Sure, we will keep you informed of any developments and let you know once it is resolved.
Sorry for the inconvenience.
Best Regards,

The issues you have found earlier (filed as WORDSNET-6475) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.