TIOParams.PDF_Compression
Declaration
property PDF_Compression: TIOPDFCompression;
Description
Specifies the compression filter for image saved in an Adobe PDF file.
Notes:
- 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- If your image is monochrome (
BitsPerSample and
SamplesPerPixel = 1) and you specify compression as ioPDF_JPEG, it will be set to ioPDF_G3FAX2D
- If you are using a
TIEMultiBitmap or
TImageEnMView, you can use
DuplicateCompressionInfo to propogate the parameter to all frames
- For ioPDF_JPEG compression, you can specify the JPEG quality and other properties using:
JPEG_Quality,
JPEG_Smooth,
JPEG_ColorSpace,
JPEG_DCTMethod,
JPEG_OptimalHuffmanDefault: ioPDF_G4FAX (if the image is color, it will default to ioPDF_UNCOMPRESSED)
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.IO.Params.PDF_PaperSize := iepA4;
ImageEnView1.IO.Params.PDF_Compression := ioPDF_Jpeg;
ImageEnView1.IO.Params.JPEG_Quality := 90;
ImageEnView1.IO.Write('D:\out.pdf');