We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

First Page Header Field not updating

I have a template file that has first page header and the header for other pages. Both the headers contains filed for current page and the total page count.

I am copying the headers from this template to a document. After setting fields in the template I call


and save it. The resulting file updates all the properties, except the page count in the first page header. ll reflects the value copied from the template. Since the template had 2 pages, it shows as Page 1 of 2. The headers in the other pages are updated fine.

Is there any other call to update first page header field?

Thanks for your inquiry. UpdateFields method does not update page numbers and page count fields. This method updates DOCPROPERTY and DOCVARIABLE fields only.
If you need to update all fields inside your document you should do this manually (ctrl+A and F9). Also you can use macro to update fields. See the following link to learn more.
Best regards.