将单页 PDF 转换为图像
我正在尝试使用以下代码将 pdf 转换为图像
from pdf2image import convert_from_path
pages = convert_from_path('Sample.pdf', 50, poppler_path=r'C:\Program Files\poppler-20.11.0\bin')
pages[0].save('OutImage.jpg', 'JPEG')
该代码正在运行,但我正在尝试控制输出图像以使其大小为 1389 x 1965 请你指导我好吗?
I am trying to convert pdf to an image using the following code
from pdf2image import convert_from_path
pages = convert_from_path('Sample.pdf', 50, poppler_path=r'C:\Program Files\poppler-20.11.0\bin')
pages[0].save('OutImage.jpg', 'JPEG')
The code is working but I am trying to control the output image to make its size 1389 x 1965
Can you guide me, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到
convert_from_path大小参数代码>函数
使用示例:
Found size parameter of
convert_from_path
functionExample of using it: