gpt4 book ai didi

python - 如何在 Python 中检测 PDF 文档中的旋转页面?

转载 作者:行者123 更新时间:2023-11-28 18:33:38 25 4
gpt4 key购买 nike

给定一个包含多个页面的 PDF 文档,如何检查给定页面是否旋转(-90、90 或 180º)?最好使用 Python (pdfminer, pyPDF) ...

更新:页面已扫描,大部分页面由文本组成。

最佳答案

我在 PyPDF2 中简单地使用了页面的 /Rotate 属性:

 pdf = PyPDF2.PdfFileReader(open('example.pdf', 'rb'))
orientation = pdf.getPage(pagenumber).get('/Rotate')

它可以是090180270None

关于python - 如何在 Python 中检测 PDF 文档中的旋转页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34515674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com