マルチページサポート付きTIFFをPDFに変換

IronPDF for Python の ImageToPdfConverter クラスは、TIFF ファイルをPDF ドキュメントに変換することをサポートします。 複数フレームを持つ TIFF を ImagePdfConverter.ImageToPdf で使用すると、TIFF の各フレームは別々のページに配置されます。

以下は、マルチフレームの TIFF イメージを PDF ドキュメントに変換するために ImageToPdfConverter を使用する方法の例です。

コードの説明

  1. モジュールのインポート:

    • PdfDocument and ImageToPdfConverter are imported from the ironpdf package to handle the PDF conversion.
  2. Function convert_tiff_to_pdf(tiff_path: str, pdf_output_path: str):

    • This function takes a TIFF file (via tiff_path) and converts it into a PDF document, saving it to the specified path (pdf_output_path).
  3. ImageToPdfConverter インスタンス:

    • An instance of ImageToPdfConverter is created to utilize its image_to_pdf method for conversion.
  4. PDF 変換:

    • The method image_to_pdf(tiff_path) converts the multi-frame TIFF by placing each frame on a separate page in the resulting PDF.
  5. PDF の保存:
    • The converted PDF is saved using the save method of the PdfDocument class at the specified path.

'path/to/your/tiff_file.tiff''path/to/output/pdf_document.pdf' を実際のファイルパスに置き換えて変換を実行します。

PythonでPDFを画像に変換する方法を学ぶ

準備はできましたか?
バージョン: 2025.9 リリース