Here is the PDF I’m working with
This PDF is growing in size after the optimization calls.
Here is the code:
`using (MemoryStream saveStream = new MemoryStream())
{
var optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions();
optimizationOptions.ImageCompressionOptions.CompressImages = CompressImages;
if (CompressImages)
{
optimizationOptions.ImageCompressionOptions.ImageQuality = ImageQuality;
optimizationOptions.ImageCompressionOptions.ResizeImages = ResizeImages;
if (ResizeImages)
{
optimizationOptions.ImageCompressionOptions.MaxResolution = MaxResolution;
}
}
optimizationOptions.ImageCompressionOptions.Version =
GetCompressionVersion(ImageCompressionVersion);
optimizationOptions.LinkDuplcateStreams = LinkDuplicateStreams;
optimizationOptions.AllowReusePageContent = AllowReusePageContent;
optimizationOptions.UnembedFonts = UnembedFonts;
doc.OptimizeSize = true;
doc.OptimizeResources(optimizationOptions);
doc.Save(saveStream);
resultBytes = saveStream.GetBuffer();
}`