We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

InsertHtml and a long HTML


I’m trying to convert a html file (see attachment) to PDF but it doesn’t give me the right result.
the html contains long image and it can’t fit in one page. As a result Aspose.Words only take the first page only and truncated the rest. When I opened the same file in Word 2013 it is seperated in multiple pages, till all fit in. The code i’m using:

Dim wordDocument As New Document
Dim docBuilder As New DocumentBuilder(wordDocument)


For Each curTable As Aspose.Words.Tables.Table In wordDocument.GetChildNodes(NodeType.Table, True)
curTable.PreferredWidth = Aspose.Words.Tables.PreferredWidth.FromPercent(100)
curTable.AllowAutoFit = True

Dim paragraphs As NodeCollection = wordDocument.GetChildNodes(NodeType.Paragraph, True)

For Each currenParagraph As Aspose.Words.Paragraph In paragraphs currenParagraph.ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle = True
currenParagraph.ParagraphFormat.SpaceAfter = 0
currenParagraph.ParagraphFormat.SpaceBefore = 0

wordDocument.TrackRevisions = False
wordDocument.Save(filename, Aspose.Words.SaveFormat.Pdf)

Any idea how to fix this?

Thank’s a lot in advance.


Hi Inoel,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12729. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Please note that Aspose.Words mimics the same behavior a MS Word does. If you load the Html in MS Word and convert it to Pdf, some big images are also truncated.

Hello Tahir,

Thank’s for the notification.
looking forward to hear from you soon.