ImageEn, unit iexBitmaps

TIOPDFCompression


Declaration

  TIOPDFCompression = (
    ioPDF_UNCOMPRESSED,
    ioPDF_RLE,
    ioPDF_G4FAX,
    ioPDF_G3FAX2D,
    ioPDF_JPEG,
    ioPDF_LZW
    );


Description

Value Description Support Color? Support Monochrome?
ioPDF_UNCOMPRESSED No compression      
ioPDF_RLE Run length compression      
ioPDF_G4FAX G4Fax (black & white images only)      
ioPDF_G3FAX2D G3Fax (black & white images only)      
ioPDF_JPEG DCT-JPEG (color images only)      
ioPDF_LZW LZW compression      

Note:
Monochrome images (BitsPerSample and SamplesPerPixel = 1) do not support ioPDF_JPEG. If specified, ioPDF_G4FAX will be used instead
Color images do not support ioPDF_RLE, ioPDF_G4FAX or ioPDF_G3FAX2D. If specified, ioPDF_UNCOMPRESSED will be used instead
If your image contains transparency (HasAlphaChannel = True) and is not monochrome, use ioPDF_LZW or ioPDF_UNCOMPRESSED to include it in the PDF. ioPDF_JPEG can also be used but artifacts may be visible. The Alpha channel makes the file size much larger, so you may want to remove it
For ioPDF_JPEG, you can specify the JPEG quality and other properties using: JPEG_Quality, JPEG_Smooth, JPEG_ColorSpace, JPEG_DCTMethod, JPEG_OptimalHuffman


Examples

// Convert monochrome TIFF to PDF
ImageEnView1.IO.LoadFromFile('D:\input.tif');
ImageEnView1.IO.Params.PDF_Compression := ioPDF_G4FAX;
ImageEnView1.IO.SaveToFile('D:\output.pdf');

// Convert full color PNG to PDF
ImageEnView1.IO.LoadFromFile('D:\input.png');
ImageEnView1.IEBitmap.RemoveAlphaChannel( True );    // Discard any alpha channel if not needed to reduce file size
ImageEnView1.IO.Params.PDF_PaperSize   := iepA4;
ImageEnView1.IO.Params.PDF_Compression := ioPDF_JPEG;
ImageEnView1.IO.Params.JPEG_Quality    := 90;
IEGlobalSettings().PDFEngine := ieenNative;          // For compression support
ImageEnView1.IO.SaveToFile('D:\out.pdf');