How to add page number to a pdf file?
问题 I've been trying all morning to add page numbers to a pdf document, but I can't figure it out. I'd like to use python, with pyPdf or reportlab. Does anyone have any ideas? 回答1: Here is my Python code to Add Page Number to PDF file. I have used both pyPdf2 and reportlab. #!/usr/bin/env python3 # -*- coding: utf-8 -*- helpDoc = ''' Add Page Number to PDF file with Python Python 给 PDF 添加 页码 usage: python addPageNumberToPDF.py [PDF path] require: pip install reportlab pypdf2 Support both Python2