Calling UpdateTableLayout method causes text cut off issue on few tables in pdf

Hi Aspose,

We have Aspose.Total license and we are using Aspose v21.7.0 for converting HTML to Word and PDF document.

We are currently experiencing an issue with tables inside a document in pdf. We are calling Aspose method “UpdateTableLayout” to fix the wrap and spacing issues in pdf for few tables. But calling this method causes the text to be cut off in other tables. This issue exists only in pdf not in word.

Here, I have a table with two columns. Each of these columns contain another table with some content in it. Here the second column content is getting cut off (hidden/ missing) when we call the UpdateTableLayout method.

Please refer to the screenshots for better understanding.

Expected:

image.png (32.1 KB)

Actual:

image.png (22.9 KB)

Example Code:

var inputFilePath = "InputFilePath";

var doc = new Document(inputFilePath, new LoadOptions { Encoding = Encoding.UTF8 });

var outputFilePath = "OutputFilePath";

var saveOptions = SaveOptions.CreateSaveOptions(outputFilePath);

doc.UpdateTableLayout();

doc.Save(outputFilePath, saveOptions);

Also please find the attached sample HTML which can be used to reproduce the issue.

Sample Html File:

testChart.zip (318 Bytes)

Please have a look into this issue and let us know if any information required.

@kishanth As I can see your document is rendered correctly without calling UpdateTableLayout method. out.pdf (21.2 KB)

Please note 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.

@alexey.noskov, Thanks for the update, yes we too noticed that. But here we are calling method “UpdateTableLayout” to fix the wrap and spacing issues in pdf for few tables. But calling this method in turn causes the text cut off in other tables .

For eg: Our document has two tables , say. Table 1 and Table2. Table1 has some text wrap and spacing issues. So to avoid these kind of issues we are calling UpdateTableLayout method which fixes the issue in Table 1 but creating the cut off issue (render issue) in Table2.

So is there a way to restrict the update table layout changes at the table level instead of the document level?

@kishanth Unfortunately, there is no such option to update a particular table layout. As an possible workaround you can render parts of your document separately, call Document.UpdateTableLayout() where it is required and then concatenate the result.