Word to PDF conversion issue with table width, alignment and spacing issues using .NET

We are using mail merge functionality to merge customer data into document template.
Recently, we purchased license to upgrade Aspose from 13.5 to 19.12.

Now, We are running into so many formatting specific issues after upgrading Aspose.
These issue seems to be more specific to save merged document with PDF.

For example,

Case 1:
See Pre and Post upgrade results of our document templates.

Pre Upgrade Result:
Pre upgrade - 1.png (29.7 KB)

Post Upgrade Result:
Post Upgrade -1.PNG (29.4 KB)

Case 2:
Post Upgrade Result text is wrapping in table cell.
Post Upgrade - Date Wrapping.png (109.5 KB)

There are other issues as well, but Its difficult to explain each and every issue.
So, I want to understand what kind of changes with respect to formatting was done from 13.6 to 19.12 and how I can resolve this.

Does Aspose provides any flag to run merge functionality with older way of formatting?

Because, we have so many customers using our provided document templates and also they have facility to create their own. Now, we don’t want to change template for each customer to fix this kind of issues. It will be very costly.

So, we want solution from code side to fix all these types of formatting issues instead of updating templates that were previously working properly.

Let me know if you need further details.

@Rakesh2013

We suggest you please try the latest version of Aspose.Words for .NET 20.6. You can get 30 days temporary license and apply it before importing document.

If you still face problem, please attach the following resources here for testing:

  • Your input Word documents.
  • Please attach the output PDF file that shows the undesired behavior.
  • Please attach the expected output PDF file that shows the desired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hello, I have also tried with latest version 20.6. But facing the same issue.
I have created sample application to represent Table Width related issue post upgrade.

  • Template -> Test-TableWidth.docx
  • Output in PDF -> Test-Merge.pdf
  • Output in Docx -> Test-Merge.docx

Both the application have same code, only Aspose dll is changed.

TableWidthIssue-Latest Aspose 19_12.zip (5.6 MB)

TableWidthIssue-Old Aspose 13_5.zip (4.2 MB)

Based on further research, I have find out the function UpdateTableLayout seems to be responsible for this issue in Latest Aspose. If I don’t call this function before save to PDF then output is correct.
But, the problem is I can’t remove this function call based on just this once incident. Because, our application (with Aspose 13.5) is very much old and word wide customers are using this merge functionality. There might be some reason on call of this function.

Before I remove this function call, I just want to make sure that It will not create any issue with other documents.

So, can you/your team tell us why UpdateTableLayout is behaving differently in two different Aspose Version?

@Rakesh2013

Please do not call Document.UpdateTableLayout method to get the correct output.

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.

Yes, I read these statements in Aspose help content of UpdateTableLayout.
But, I want to know, If I use this function to fix issue in one document, will it misbehave or create issue to other documents.

@Rakesh2013

We have logged this problem in our issue tracking system as WORDSNET-20667. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hello Tahir,

Any update on this issue?

@Rakesh2013

Your issue is related to missing feature WORDSNET-832 ( Make table layout as close to Word as possible ). The WORDSNET-20667 has been postponed due to this missing feature.

After the fix of WORDSNET-832, we will look into your issues. We will be sure to inform you via this forum thread as soon as this feature is available. We apologize for your inconvenience.

A post was split to a new topic: Table spacing issue when saving from Word to PDF