Retrieve page numbers from document with pyPDF

后端 未结 5 1644
逝去的感伤
逝去的感伤 2020-12-28 15:51

At the moment I\'m looking into doing some PDF merging with pyPdf, but sometimes the inputs are not in the right order, so I\'m looking into scraping each page for its page

5条回答
  •  清酒与你
    2020-12-28 16:02

    The following worked for me:

    from PyPDF2 import PdfFileReader
    pdf = PdfFileReader(open('path/to/file.pdf','rb'))
    pdf.getNumPages()
    

提交回复
热议问题