Convert large TIFF images to PDF

XFINIUM.PDF 6.8 brings support for converting very large TIFF to PDF with very low memory consumption.
Large TIFFs (hundreds of megabytes or higher, commonly found in printing industry) can be converted to PDF using only a few megabytes of memory, assuming that both the input TIFF image and the output PDF file are stored on disk.
The new class for handling these images is called PdfXLTiffImage and it is used just like its sibling class PdfTiffImage.
The constructor of PdfXLTiffImage class takes a Stream as parameter and a frame number and the only requirement is that this Stream is available till the PDF file is generated.
The conversion of TIFFs to PDF using the PdfXLTiffImage class is shown below:

If the TIFF image has multiple frames and you want to convert all of them to PDF the code below shows how this can be accomplished:

If you want the library to dispose the tiff stream after the PDF file was created, so that you don’t have to keep track of it, you can set the third parameter of the PdfXLTiffImage constructor to true.

This class can be used to convert any TIFFs to PDF, not just very large ones. In fact, if you have to convert many TIFFs to PDF (for example you create a photo album), this class can help lower the memory usage.
In our tests, using a console application, a 3.5GB TIFF image was converted to a PDF file using only 30 MB of mmeory.

Leave a Reply