【问题标题】:count number of pages in a pdf file using python's pypdf2 library使用 python 的 pypdf2 库计算 pdf 文件中的页数
【发布时间】:2023-02-19 20:00:40
【问题描述】:

使用 Py2PDF 库查找 PDF 中的总页数的确切代码是什么? .numPages 的旧方法已弃用

【问题讨论】:

    标签: python python-3.x pdf


    【解决方案1】:

    使用.pages方法

    from PyPDF2 import PdfReader
    
    reader = PdfReader("US_Declaration.pdf")
    readpdf = len(reader.pages)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-29
      • 2011-11-19
      • 1970-01-01
      • 2021-12-28
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      相关资源
      最近更新 更多