HTML to PDF issue with Display:Table define in class


I am trying to convert a HTML file to PDF using below code:

Dim opt As New Aspose.Words.LoadOptions()
opt.LoadFormat = Aspose.Words.LoadFormat.Html
Dim doc As New Aspose.Words.Document(FilePath, opt)
Dim options As New Aspose.Words.Saving.PdfSaveOptions()
options.TextCompression = Aspose.Words.Saving.PdfTextCompression.Flate
doc.Save(pdfFilePath, options)

The problem is happening when I have a DIV element with associated css as below (defined inside html file):

The above CSS is not applied during conversion, but the below code is working:

What is the issue and how can be resolved? I am using version 9.

Hi David,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 15.11.0 and have not found the shared issue. Please use Aspose.Words for .NET 15.11.0.


I just downloaded the Aspose.Words for .NET 15.11 and got the same issue.

Please see attached “Test.txt” file which is my html page and attached PDF file is how it is converted to PDF.

I used below code:

Dim dataDir As String = Path.GetFullPath("…/…/…/Data/")

’ Load the document from disk.
Dim doc As New Document(dataDir & “HTMLPage2.html”)

’ Save the document in PDF format.
doc.Save(dataDir & “Doc2PdfSave Out1.pdf”)

please let me know what the issue is?

Hi David,

Thanks for your inquiry. Could you please attach your complete input html here for testing? We will investigate the issue on our side and provide you more information.

Hi Tahir,

I saved it as text file since we can’t attach html file.

This is a major issue in our production and we need a solution ASAP.


Hi David,

Thanks for sharing the detail. Please note that Aspose.Words mimics the same behavior as MS Word does. If you open your Html in MS Word and save it to Pdf, you will get the same output. We have attached the output document with this post for your kind reference.