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

Free Support Forum - aspose.com

Table formatting inconsistencies when creating PDF and Docx files from a Document object


When generating a PDF file from a Document object that contains a Table, the columns are not correctly formatted. The issue seems to occur when a cell contains a long string that does not contain any spaces.

Please see the attached project for an example of the issue.


Hi Michael,

Thanks for your inquiry. In your case, I suggest you please call Document.UpdateTableLayout method before saving the document to PDF to solve the shared issue. This method updates widths of cells and tables in the document according to their preferred widths and content.

You do not normally need to call this method as cell and table widths are maintained automatically. You can call this method before exporting to PDF (or any other fixed-page format), only in rare cases where you confirmed that tables appear incorrectly laid out in the output document. Calling this method might help to correct the output.

Please let us know if you have any more queries.