TIFF zu PDF mit Unterstützung für mehrere Seiten

Die Klasse ImageToPdfConverter von IronPDF for Python unterstützt die Umwandlung von TIFF-Dateien in PDF-Dokumente. Wenn ImagePdfConverter.ImageToPdf mit einem mehrseitigen TIFF verwendet wird, wird jeder Rahmen des TIFF auf separaten Seiten platziert.

Hier ist ein Beispiel, wie Sie den ImageToPdfConverter verwenden können, um ein mehrseitiges TIFF-Bild in ein PDF-Dokument umzuwandeln:

Erklärung des Codes

  1. Module importieren:

    • 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 Instanz:

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

    • 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 speichern:
    • The converted PDF is saved using the save method of the PdfDocument class at the specified path.

Ersetzen Sie 'path/to/your/tiff_file.tiff' und 'path/to/output/pdf_document.pdf' durch Ihre tatsächlichen Dateipfade, um die Umwandlung durchzuführen.

Lernen Sie, wie man mit Python PDF in Bilder konvertiert

Bereit anzufangen?
Version: 2025.9 gerade veröffentlicht