python - 如何在 Python 中将 PDF 转换为 TIFF [CCITT Group 4 传真编码压缩]?
问题描述
我有一个 PDF 文件,我想通过 CCITT Group 4 Fax Encoding 的压缩将 PDF 文件拆分为 TIFF 文件格式的图像。我已使用 pdf2image 转换为 TIFF,但无法转换为压缩 CCITT Group 4 Fax Encoding。我使用下面的代码转换为 TIFF。你能帮我压缩 CCITT Group 4 Fax Encoding 格式的 TIFF 图像吗?
from pdf2image import convert_from_path
TIFFPdf = convert_from_path(pdf, poppler_path=config['APPLICATION_LOCATION']['POPPLER_PATH'])
for img in TIFFPdf:
img.save(str("{:04d}".format(imageId)) + '.tiff', 'TIFF')
imageId += 1
解决方案
推荐阅读
- javascript - 构建第一个大型 React 应用程序
- c++ - 使用可变模板函数在labmda中传递对文字的正确引用时出现段错误
- r - R Markdown 删除最后一列
- r - R使用蒙特卡罗或类似方法创建函数
- mysql - ER_TRUNCATED_WRONG_VALUE:不正确的日期值:'0' - 具有正确 DATE 值的 NodeJS
- local-storage - 为什么刷新页面时本地存储中的项目顺序会发生变化?
- html - 表情符号模式弹出窗口适用于本地主机,但不适用于服务器端
- java - 在不同类中的 for 循环后返回变量
- javascript - 使用 javascript 将文本文件读入数组时出现意外行为
- javascript - 如果 td 段落有类,隐藏 tr 类