Width problem converting HTML table to Pdf

Hi, we have recently purchased the Aspose.Pdf component and we are trying to create a table from an HTML string. The table is generated but the width attribute of the html table is not taked into acount. Seems like the table takes the width of the elements that are inside each cell. Below is the code we use to generate de table, is there any mistake?

Pdf pdf1 = new Pdf();

Aspose.Pdf.Section sec1 = pdf1.Sections.Add();

string st = "

cell 1    celll 2 cell 3 cell 4
cell 5 cell 6 cell 7 cell 8
";

Text text1 = new Text(st);

text1.IsHtmlTagSupported = true;

sec1.Paragraphs.Add(text1);

pdf1.Save("C:/test.pdf");

Thanks in advance,

Sebastian

Hi,

Thank you for considering Aspose.

We are unable to reproduce this error. The code you are using is correct. Please make sure you are using the latest version of Aspose.Pdf 3.5.4.0. Please find attached output PDF for your reference.

Thanks.

Adeel Ahmad
Support Developer
Aspose Changsha Team
http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

I have observed a similar problem with the width of tables not being transferred to the PDF. (using Aspose.Pdf 3.5.4.0)

For example, the HTML below should create a table filling the width of the page, with two cells of equal width. But the table on the PDF is very small, and does not fill the page.

test test2

Hi,

I have rechecked it again, and I think there is some problem with inline HTML. BindHTML function works well. I will discuss this with the developers and we will let you know as soon as solution is found.

Thanks.

Adeel Ahmad
Support Developer
Aspose Changsha Team
http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

Hi,

After discussing with the developers, I found that in the latest version we used FitToContent for table
which means the width of the column will be calculated based on the content and we haven’t supported this in BindHtml. In BindHtml function table column width is calculated based on page width. We will try to support AutoFitToContent and
AutoFitToWindow(FitToPage) for both inline HTML and BindHTML in future version.


Thanks.

Adeel Ahmad
Support Developer
Aspose Changsha Team
http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

Thank you very much Adeel. Do you have any idea of when this upgrade will be ready?

Thanks,

Sebastian

Hi,

I have notified our developers about this enhancement, they will give you an ETA soon.

Thanks.
Adeel Ahmad

Support Developer

Aspose Changsha Team

http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

Hi,

After discussing it with the developers I hope FitContent in BindHTML can be supported next week
and FitWindow for both inline HTML and BindHTML can be supported two weeks
later.

Thank you for your patience.

Adeel Ahmad
Support Developer
Aspose Changsha Team
http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

Hi,

Please try hotfix 3.5.8.