1

I'm generating a .docx document and I want to add the page number and the sum of the page in the header section.
Like in this image (yellow background):
enter image description here

How can I do that? Thank you very much

m0r7y
  • 670
  • 1
  • 8
  • 27
  • Check this [doc](https://python-docx.readthedocs.io/en/latest/dev/analysis/features/header.html). – CodeIt Aug 13 '19 at 07:05

1 Answers1

0

Unfortunately page breaks are not inserted by the .doxc file but by the rendering engine so you can't accurately get page counts. However people have asked this before and you might be able to use a script to estimate Page number python-docx

aaaakshat
  • 809
  • 10
  • 19