ImageEn, unit iexBitmaps




property PDF_Compression: TIOPDFCompression;


Specifies the compression filter for image saved in an Adobe PDF file.

- This property is only used when saving PDF files natively, e.g. using TImageEnIO.SaveToFilePDF or TImageEnMIO.SaveToFilePDF (and the PdfViewer is disabled). It is NOT used when saving with PDFium
- 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
- If you are using a TIEMultiBitmap or TImageEnMView, you can use DuplicateCompressionInfo to propogate the parameter to all frames

Default: ioPDF_G4FAX (if the image is color, it will default to ioPDF_UNCOMPRESSED)


// Convert monochrome TIFF to PDF
ImageEnView1.IO.Params.PDF_Compression := ioPDF_G4FAX;

// Convert full color PNG to PDF
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;