Hello,
has there been progress on PDFNET-42356? I am running into the same issue in Aspose Java. The tables in my HTML have fixed width which renders just fine in browsers but is ignored by Aspose.
If there is another way to force Aspose to respect the fixed col width please let me know.
@yvesb I am afraid it is not always possible to retain HTML formatting in MS Word document. It seems in your code you use code like the following to convert your document tp PDF:
Document doc = new Document("C:\\Temp\\aspose-table-col-size.html");
Iterable<Table> tables = doc.getChildNodes(NodeType.TABLE, true);
for (Table t : tables)
t.autoFit(AutoFitBehavior.FIXED_COLUMN_WIDTHS);
doc.save("C:\\Temp\\out_FIXED_COLUMN_WIDTHS.pdf");
Here is output produced by this code on my side: out_FIXED_COLUMN_WIDTHS.pdf (26.9 KB)
The output is similar to what MS Word produces: msw.pdf (7.2 KB)
If do not set additional properties upon conversion to PDF, Aspose.Words produces the following output: out.pdf (27.1 KB)
Document doc = new Document("C:\\Temp\\aspose-table-col-size.html");
doc.save("C:\\Temp\\out.pdf");
In your HTML you use column width, but in MS Word table there is no concept of column, each row in the table is independent and can contain any number of cells of any width. In your case, Aspose.Words by default takes <table style="width: 100%; table-layout: fixed;"> in account and fits the whole table with to page. Which is an expected behavior.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.