PDFKit5 includes support for non-desctructive PDF compresssion. Invoking the compression tool is as simple as follows:
using (FileStream input = new FileStream(inputPath, FileMode.Open, FileAccess.Read))
using (FileStream output = new FileStream(outputPath, FileMode.Create, FileAccess.Write))
Document.Rewrite(input, output, ReduceOptions.All);
The compression algorithm can be fine tuned using the ReduceOptions enum by enabling any of the following optional steps:
We have sent an email with a download link.