We have problem with insert page number in document. i have attached documents Please find and give as solution.
Note: Some Files Only Not Working Properly
We have tested the scenario and have not found any issue. Could you please share the issue that you are facing while inserting the Page field? We will then provide you more information about your query.
As per our understanding, you want to insert page number at the start of each page. We suggest you please move the cursor to the header of document using DocumentBuilder.MoveToHeaderFooter method and insert the page field.
If this does not help you, 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.
@tahir.manzoor and Team,
I try to use “DocumentBuilder.MoveToHeaderFooter method and insert the page field.” but I am not getting expected output
I attached expected, actual output and input file
If you still want to insert the page number field in the page’s body, you need to register the hyphenation dictionary as shown below. After registering the English dictionary, the page layout will be correct and you can get the correct Run/Paragraph node at the start of page.
Above code working fine but some files also face the same issue.
I attached Screen Shots for the issue pages Issue output.zip (393.3 KB)
Note: Expected output already sent before (Insert Page Number Issue - #5 by rjnick)
In your case, the layout API does not get the correct text (Run node) at the start of page. So, you get the incorrect position of page field. We have logged this problem in our issue tracking system as WORDSNET-18825. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.
After the fix of this issue, you can use the same code to insert the page field.
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.
Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-18825) as ‘Not a Bug’.
Your problem in the document is related to hyphenation dictionary. You should perform following change in the hyph_en_US.dic:
Add next patterns to the bottom of the hyph_en_US.dic:
.medi9cine.
.surger9ies.
.health8care.
.un9con9ven9tion9al.
.mil9li9me9ters.
.mea8s9ure9ments.
.im9por8tant.
.ar9throplasty.
.cer9e9bro9spi9nal.
.spi9nal.
.need9ed.
.fund9ed.