TIFF a PDF con soporte para múltiples páginas

La clase ImageToPdfConverter de IronPDF para Python admite la conversión de archivos TIFF en documentos PDF. Cuando se usa ImagePdfConverter.ImageToPdf con un TIFF que contiene múltiples cuadros, colocará cada cuadro del TIFF en páginas separadas.

Aquí tienes un ejemplo de cómo puedes usar el ImageToPdfConverter para convertir una imagen TIFF de múltiples cuadros en un documento PDF:

Explicación del Código

  1. Importación de Módulos:

    • 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. Instancia de ImageToPdfConverter:

    • An instance of ImageToPdfConverter is created to utilize its image_to_pdf method for conversion.
  4. Conversión a 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. Guardando el PDF:
    • The converted PDF is saved using the save method of the PdfDocument class at the specified path.

Reemplace 'path/to/your/tiff_file.tiff' y 'path/to/output/pdf_document.pdf' con sus rutas de archivo reales para realizar la conversión.

Aprende a convertir PDF en imágenes con Python

¿Listo para empezar?
Version: 2025.9 recién lanzado