Retrieve page numbers from document with pyPDF

后端 未结 5 1618
逝去的感伤
逝去的感伤 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:17

    Another Option is pymupdf: https://pymupdf.readthedocs.io/en/latest/tutorial.html

    import fitz
    
    doc = fitz.open('Path To File')
    doc.pageCount
    

    pip install pymupdf

    For large documents I was getting a recursion error when using pypdf2 so this was another quick and simple way.

提交回复
热议问题