Wrong format in Merge cell table


Here is my original template:

AGENCY FACILITIES AND/OR SERVICES START DATE / MATURITY DATE CURRENT TAX LEVY MAX TAX LEVY
«MRP3_Agency» «MRP3_Improvements» «MRP3_StartEndYear» «MRP3_Levy» «MRP3_MaxTax»
MAX. TAX ESCALATOR CONTACT PHONE NUMBER ACCELERATED FORECLOSURE
(YES OR NO1)
«MRP3_MaxTaxEscalator» «MRP3_Contact» «MRP3_PhoneNumber» «MRP3_AccForeclosure»

after I replace the merge fields, it turns out correct:

AGENCY FACILITIES AND/OR SERVICES START DATE / MATURITY DATE CURRENT TAX LEVY MAX TAX LEVY
SFUSD CFD 90-1 REPAIR, RESTORATION AND REPLACEMENT OF FACILITIES DAMAGED BY EARTHQUAKE. SENIOR EXEMPTION AVAILABLE. 1990/1991
2030/2031
$ 32.64 $32.64 PER SFD, $16.32 PER MFD
MAX. TAX ESCALATOR CONTACT PHONE NUMBER ACCELERATED FORECLOSURE
(YES OR NO1)
0% SFUSD (415) 241-6480 NO

but after I ran:

master.UpdateTableLayout();
master.UpdatePageLayout();
master.UpdateFields();

it turns out incorrect:

AGENCY FACILITIES AND/OR SERVICES START DATE / MATURITY DATE CURRENT TAX LEVY MAX TAX LEVY
SFUSD CFD 90-1 REPAIR, RESTORATION AND REPLACEMENT OF FACILITIES DAMAGED BY EARTHQUAKE. SENIOR EXEMPTION AVAILABLE. 1990/1991
2030/2031
$ 32.64 $32.64 PER SFD, $16.32 PER MFD
MAX. TAX ESCALATOR CONTACT PHONE NUMBER ACCELERATED FORECLOSURE
(YES OR NO1)
0% SFUSD (415) 241-6480 NO

I can’t drop the UpdateTableLayout() command, because it helps to fix the other table issues.
I used the latest version of Aspose.Words.
Thanks.
Tom

Hi Tom,
If you can share the source word file, may be someone can check this problem and share his findings.

Hi Tom,

Thanks for your inquiry.

In cases when you save the document in Word formats, you do not normally need to call this method as cell and table widths are maintained automatically. However, you may 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 visit the following link for more details:

The UpdateTableLayout Method

Moreover, could you please share the other table problems you would be facing in case if you dropped the UpdateTableLayout method.

Please let us know if you need more information, We are always glad to help you.

Best Regards,

You are right. I have several tables with MergeFields before that table. 2 of those tables had the issue when converting to PDF, their size went off the page, that is why I have to run UpdateTableLayout to fix them before exporting to PDF. It helps to fix the issue with those 2 tables but causes this table format wrong as previous post.
Tom.

Hello
Thank you for additional information. As another workaround of the issue with table width (instead of UpdateTableLayout), you can try specifying a fixed column width. This should resolve the problem.
Best regards,