需要以 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 其他要求。