Office incorrect automatic page number

WebViewer Version:
8.4.1

When previewing an office file (.docx) and using the “NumPages” function inside the file, page numbers display abnormally when previewing the file using JavaScript.
The total number of pages is 5.

JavaScript:
1-1

WebViewer:
2-1

1 Like

Hi rsc,

There is a known problem for incorrect total page count when displaying DOCX in WebViewer.
Please check out this post below:

Regards,
Maggie V.

1 Like

I tried this configuration, but it didn’t work at all.


But when I use the WebViewer server to convert this file, even without using this configuration, the page numbers can still be displayed normally.


1 Like

Hi rsc,

The hideTotalNumberOfPages API will hide the total page count in the footer of a docx file if it has any.
Example this attached file “pageNumTest.docx” below shows total pages using Word (screenshot-1) and hides it using WebViewer (screenshot-2).
pageNumTest.docx (14.5 KB)

Screenshot-1
screenshot-1

Screenshot-2
screenshot-2

instance.UI.loadDocument('.../pageNumTest.docx', {
  officeOptions: {
    formatOptions: {
      hideTotalNumberOfPages: true,
    }
  }
})

Nevertheless, WebViewer will display the total page count correctly using this API instance.Core.documentViewer.getDocument().getPageCount().

Could you try loading the file that has the issue using our showcase https://showcase.apryse.com/office-documents?

Regards,
Maggie V.

1 Like

The issue should be caused by a lower version, and using the provided showcase can display it normally.

Thanks.

1 Like