Converting DOCX to PDF in WebViewer may show incorrect total page count

When I open an Office file in WebViewer I see the page numbers in the footer show an incorrect total page count.

This is due to incorrect info in the DOCX, so WebViewer believes that is how many pages there are, when opening the document for viewing.

There are a few optimizations WebViewer takes to ensure DOCX files render as fast as possible, and relying on the metadata in the DOCX for the page count is one.

If you download the PDF from WebViewer (from the Gear icon in top right corner) you will see that the downloaded PDF has “Page 1 of 2” because during the download we know we are not viewing (not interactive) so we can delay until reflowing the DOCX is done and the actual page count is determined.

What you can do is hide the total page numbers in WebViewer using the following code:

  instance.loadDocument('http://localhost:3004/samples/viewing/viewing/pageNumTest.docx', {
    officeOptions: {
      formatOptions: {
        hideTotalNumberOfPages: true,

When you download the file from WebViewer, the resulting PDF file will correctly display the total page count afterwards.