Compress PDF corrupts document

Hi Aspose team,
using following code I tried to compress one PDF document:

Console.WriteLine(DateTime.Now.ToString());
// The path to the documents directory.
string dataDir = Path.GetFullPath("doc.pdf");
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(dataDir);
pdfDocument.OptimizeSize = true;
pdfDocument.Optimize();
pdfDocument.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions()
{
LinkDuplcateStreams = true,
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
CompressImages = true,
AllowReusePageContent=true,
ImageQuality = 40
});
pdfDocument.Save("output.pdf");
Console.WriteLine(DateTime.Now.ToString());


Output.pdf is with almost no content.

Can you please have a look? Test project is attached.

Btw. output document size was 118Kb where by using www.smallpdf.com and www.ilovepdf.com size was around 60kb.

I know that I am boring with compression topics (already have few tickets) but it will be excellent if you work a little bit on algorithm.

Thanks,
Oliver

Hi Oliver,

Thanks for using our API’s. have tested the scenario and am able to notice the same problem. For the sake of correction, logged this problem as PDFNEWNET-40070 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us a little time. We are sorry for this inconvenience.

Hi,

any update here?

Thanks,
Oliver

Hi Oliver,


Thanks for your patience.

The issue reported earlier is still pending for review and is not yet resolved. However I have intimated the product team to share possible updates regarding its resolution and as soon as we have some further updates, we will let you know.

The issues you have found earlier (filed as PDFNET-40070) have been fixed in Aspose.PDF for .NET 26.2.