【发布时间】:2018-02-24 06:10:26
【问题描述】:
我尝试在 Python 3 中使用 PyPDF2 模块,但无法显示“页面大小”属性。 在扫描到 PDF 文件之前,我想知道纸张尺寸是多少。
类似这样的:
import PyPDF2
pdf=PdfFileReader("sample.pdf","rb")
print(pdf.getNumPages())
但我正在寻找另一个 Python 函数,而不是例如 getNumPages()...
下面的这个命令打印某种元数据,但没有页面大小:
pdf_info=pdf.getDocumentInfo()
print(pdf_info)
【问题讨论】:
标签: python scanning pypdf2 page-size