I created PDF
file of figures with pdfpages
in matplotlib
.
Now I want to add headers (contains text and line), footer (contains text and line) and page number. How can I do that?
I created PDF
file of figures with pdfpages
in matplotlib
.
Now I want to add headers (contains text and line), footer (contains text and line) and page number. How can I do that?
Use PyMuPDF:
Decide the header and footer rectangle coordinates, then the text of each with the constant and variable parts.
Example:
Footer: One line, bottom of rectangle 0.5 inches (36 points) above bottom of page, 11 points font size, font Helvetica, text centered "Page n of m".
Header: One line, rectangle top 36 points below top of page, 20 points rect height, font Helvetica bold, text "My Matplotlib File" centered. 11 points font size, color blue.