需要以 TIFF 图像 PDF 文件吗?使用Aspose.Words for Python via .NET任何开发人员都可以轻松地将 TIFF 转换为 PDF 格式,只需几行 Python 代码。
现代图像处理 Python API 从 TIFF 图像高速 PDF 直接在浏览器中 TIFF 到 PDF 转换的质量。强大的 Python 库允许将 TIFF 图片转换为许多流行的文档格式。
以下示例演示了如何在 TIFF PDF 转换为 Python 。
按照简单的步骤将 TIFF 图像转换为 PDF 格式。从本地驱动器读取 TIFF 图像,然后将其保存为 PDF 扩展名指定所需的文档格式。对于 TIFF 读取和 PDF 写入,您可以使用完全限定的文件名。输出 PDF 内容将与原始 TIFF 图像相同。
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.insert_image("Input.tiff")
doc.save("Output.pdf")
import aspose.words as aw
doc = aw.Document("Input.tiff")
doc.save("Output.pdf")
import aspose.words as aw
doc = aw.Document(Input.tiff)
for page in range(0, doc.page_count):
extractedPage = doc.extract_pages(page, 1)
extractedPage.save(f"Output_{page + 1}.pdf")
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.insert_image("Input.tiff")
doc.save("Output.pdf")
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_image("Input.tiff")
shape.image_data.save("Output.pdf")
我们在PyPi存储库中托管我们的 Python 请按照有关如何 "Aspose.Words for Python via .NET" 安装到您的开发人员环境的分步说明进行操作。
此包与 Python 3.5, 3.6, 3.7, 3.8 和 3.9 兼容。如果您为 Linux 开发软件,请查看产品文档中 gcc 和 libpython 其他要求。