HTML data getting truncated when generating output form

The data to be displayed is in the HTML format that needs to be embedded into a defined section. When the HTML is in table format and is huge a part of it gets truncated.

We tried the below to get the contents into auto fit area of the document,

  • Imposing a parent HTML tag with defined size so that the inner contents auto adjust itself.
  • Manually resizing the table to a given size.
  • Auto fit property used within the table window

@Hamzakutty Could you please provide you HTML input, target template and your problematic output document along with a simple code example that will allow us to reproduce the problem? We will check the issue and provide you more information.

Hi @alexey.noskov,

Please find the attached .zip file which is the sample to recreate the problem that we are facing while adding multiple columns in the table.
The issues that we are facing are:

  1. The table with multiple columns is getting truncated and autofit is not happening.
  2. The image doesn’t autofits the window.

AsposeTruncationDemo.zip (617.5 KB)

Thanks for your help.

@Hamzakutty Thank you for additional information. The nested table inserted from HTML has fixed table width specified <table border='1' style='width:800px;'>. So it is not resized. This is the expected behavior. MS Word behaves the same way.
To get the expected output, you should reset table with. You can modify your HTML like this:

private static String buildDemoHtml() {
        
    return "<div style='white-space:normal;'>"
        + "<p><strong>Collateral Section</strong></p>"
        + "<table border='1'>"
        + "<tr>"
        + "<th>Req#</th>"
        + "<th>Title</th>"
        + "<th>Description</th>"
        + "</tr>"
        + "<tr>"
        + "<td>FS-002</td>"
        + "<td>Dashboard</td>"
        + "<td>"
        + "This is a long description demonstrating overflow when HTML is inserted into a Word table cell using Aspose."
        + "</td>"
        + "</tr>"
        + "</table>"
        + "</div>";
}