Çok Sayfa Destekli TIFF'den PDF'ye
IronPDF for Python'un ImageToPdfConverter sınıfı, TIFF dosyalarını PDF belgelerine dönüştürmeyi destekler. Birden fazla çerçeve içeren bir TIFF ile ImagePdfConverter.ImageToPdf kullandığınızda, TIFF'in her çerçevesini ayrı sayfalara yerleştirecektir.
İşte çok çerçeveli bir TIFF görüntüsünü PDF belgesine dönüştürmek için ImageToPdfConverter nasıl kullanabileceğinize dair bir örnek:
Kodun Açıklaması
Modüllerin İçe Aktarılması:
PdfDocumentandImageToPdfConverterare imported from theironpdfpackage to handle the PDF conversion.
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).
- This function takes a TIFF file (via
ImageToPdfConverter Örneği:
- An instance of
ImageToPdfConverteris created to utilize itsimage_to_pdfmethod for conversion.
- An instance of
PDF Dönüşümü:
- The method
image_to_pdf(tiff_path)converts the multi-frame TIFF by placing each frame on a separate page in the resulting PDF.
- The method
- PDF'nin Kaydedilmesi:
- The converted PDF is saved using the
savemethod of thePdfDocumentclass at the specified path.
- The converted PDF is saved using the
Dönüştürmeyi gerçekleştirmek için gerçek dosya yollarınızı 'path/to/your/tiff_file.tiff' ve 'path/to/output/pdf_document.pdf' ile değiştirin.






