This sample shows how to change the compression scheme of an image while adding it to a PDF document.
To recompress an image or a frame of an image before adding it to a PDF document:
- Open the image using the PdfDocument.OpenImage method.
- Setup compression options for all or selected frames.
Depending on the options, the library will decompress some frames and then compress them again before adding them to the document.
You can compress images using Flate, Jpeg and CCITT compression schemes. It is possible to decompress an image completely, too.
The library can also repack the images, already added to the document.