TIFF 파일을 다중 페이지 지원 PDF로 변환
IronPDF for Python의 ImageToPdfConverter 클래스는 TIFF 파일을 PDF 문서로 변환하는 것을 지원합니다. 여러 프레임이 포함된 TIFF를 ImagePdfConverter.ImageToPdf와 함께 사용할 때, 각 TIFF의 프레임을 별도의 페이지에 배치합니다.
여기 multi-frame TIFF 이미지를 PDF 문서로 변환하는 데 ImageToPdfConverter를 사용하는 방법의 예시가 있습니다:
코드 설명
모듈 가져오기 :
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 인스턴스 :
- An instance of
ImageToPdfConverteris created to utilize itsimage_to_pdfmethod for conversion.
- An instance of
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.
- The method
- PDF 저장하기 :
- The converted PDF is saved using the
savemethod of thePdfDocumentclass at the specified path.
- The converted PDF is saved using the
실제 파일 경로를 사용하여 변환을 수행하려면 'path/to/your/tiff_file.tiff' 및 'path/to/output/pdf_document.pdf'를 대체하세요.






