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

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

ImageToPdfConverter を使用して、マルチフレーム TIFF イメージを PDF ドキュメントに変換する方法の例を次に示します。

コードの説明

  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を画像に変換する方法を学ぶ

準備はできましたか?
バージョン: 2026.3 リリース
Still Scrolling Icon

まだスクロールしていますか?

すぐに証拠が欲しいですか?
サンプルを実行するHTML が PDF に変換されるのを確認します。