Page header page number with multi page conditional text

We have created a template that conditionally inserts a page break, say on page 2.
The header says both this page and page 3 are page number 3.

@mleake

Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

TestRunner.zip (36.8 KB)

The original document is INC91783.doc
After running TemplateMerger INC91783.doc false false
We get INC91783Output.doc
The page number in the header on page 2 says ‘Header 3’ where it should say ‘Header 2’

Thanks

@mleake

We have tested the scenario using the following code example with the latest version of Aspose.Words for Java 19.6. We have not found the shared issue in output document. Please use Aspose.Words for Java 19.6.

Moreover, please make sure that you are not deleting the Page and IF fields in your code.

Document document = new Document(MyDir + "INC91783.doc");
final boolean corrected = correctFieldsTypeNone(document);

document.save(MyDir + "19.6.docx");

Thanks for your prompt reply.
I was out of the office yesterday.

I have experimented first thing today:
1 The correctFieldsTypeNone never gets called. I commented it out to make sure.
2 I have tried with 19.6 and I see the same behaviour.
3 When I comment out Field.unlink() it works, i.e. Header 2 is on page 2

Sadly we added field.unlink because our users, bless them all, dont want to see field names and { } in the final document.
Is there anthing we can call after Field.unlink to recalculate/evaluate pages.
I feel that this is an issue with Field.unlink.

@mleake

After using Field.unlink method, you can call Document.updatefields method to update the fields and call Document.updatePageLayout to rebuilds the page layout of the document.

If you still face problem, please ZIP and attach your expected output document here for our reference. We will then provide you more information about your query along with code.

SimpleTest.zip (26.2 KB)

This didn;t make any difference.
I have attached a simple example that just calls unlink on the IF field.
This seems to confuse the mail merge page numbering.

@mleake

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18854. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks-you for your time and rasing this as an issue.

Do you have a feel for when, or if, this will be addressed?

@mleake

We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.

You reported this issue in free support forum and it will be treated with normal priority. To speed up the progress of issue’s resolution, we suggest you please check our paid support policies from following link.
Paid Support Policies

The issues you have found earlier (filed as WORDSNET-18854) have been fixed in this update.