How to reduce size of a pdf file through aspose api?

Hi,


I am creating an app in window 8 that can reduce the size of a pdf file. Is there any aspose api available that can do it for me. I am already using aspose api’s for converting pdf to word and images and also other api’s like split pdf, move pdf pages etc. Is there also any aspose api available that can reduce the size of a file? If yes then please provide me it with c# sample code.


Thanks…

Hi Anand,

Thanks for your inquiry. You can easily optimize PDF size using Aspose.Pdf. Please check the following code snippet and documentation link for the details. It will help you to accomplish the task.

// load source PDF file
Aspose.Pdf.Document document = new Aspose.Pdf.Document("c:/pdftest/MergedDocument.pdf");

// optimize the file size by removing unused objects
document.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions()
    {
    LinkDuplicateStreams = true,
    RemoveUnusedObjects = true,
    RemoveUnusedStreams = true,
    CompressImages = true,
    ImageQuality = 10
    });

// save the updated file
document.Save("c:/pdftest/Optimized.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

Hi,


Thanks for the update. But I don’t want to use Aspose.pdf dll. For other tasks like Pdf to word and pdf to image I am using your services I am using your api.

http://api.saaspose.com/v1.0/pdf/convert?format=

This is the api that I am using to convert pdf. Similarly I want any api that can reduce the size of the pdf that I select from my window 8 app.

I just want to know tat Aspose.pdf is free or paid?
Do you have any such api, that can work for me?

Hi Anand,


anand89:
Hi,

Thanks for the update. But I don't want to use Aspose.pdf dll. For other tasks like Pdf to word and pdf to image I am using your services I am using your api.

http://api.saaspose.com/v1.0/pdf/convert?format=

This is the api that I am using to convert pdf. Similarly I want any api that can reduce the size of the pdf that I select from my window 8 app.


Thanks for your feedback. I am afraid the PDF file optimization is not supported in Aspose.Pdf for Cloud. However we have logged a new feature request SAASPDF-127 in our issue tracking system for further investigation and implementation. We will notify you as soon as it is implemented.

We are sorry for the inconvenience caused.

Best Regards,
Hi Anand,

anand89:
Hi,

I just want to know tat Aspose.pdf is free or paid?
Do you have any such api, that can work for me?

Thanks for your inquiry. Aspose is a commercial vendor of file format APIs, all APIs are paid so Aspose.PDF for .NET API as well. However for evaluation purpose you may ask for a 30 days temporary license and if satisfied then can purchase API as per your plan.

Please feel free to contact us for any further assistance.

Best Regards,

Hi,


Thanks for reply. I am thinking to go with your Aspose.Pdf for .Net API. I got a temporary license from Aspose. I was trying to install Aspose.Pdf for .NET but I am getting following error :

"Install-Package : Could not install package ‘Aspose.Pdf 9.7.0’. You are trying to install this package into a project that targets ‘.NETCore,Version=v4.5’, but the package does
not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."

Can you guide me, how I can use this Aspose.Pdf for .NET API.

Hi Anand,


Thanks for your reply. Please confirm some more details about the issue and share your environment details. Are you using nuget package manager for installation? Actually we do not provide some separate Aspose.Pdf for .NET dll for 4.5 .NET Framework specific. Aspose.Pdf for .NET dll for 4.0 is working fine with 4.5.

Meanwhile you may download Aspose.Pdf for .NET 9.7.0 (DLLs only) and manually reference Aspose.Pdf for .NET 4.0 dll in your project.

We are sorry for the inconvenience caused.

Best Regards,

Hi,


I tried to install it through nuget but I am getting the error that I mentioned in previous reply. I downloaded the Aspose.Pdf 9.7.0 and installed it separately and tried to add dll reference in my window 8 project. But it is also giving the version error.

I am creating an app in Winodws 8 app. It is version 4.5. I don’t know why I am getting this error. Please provide me some solution.

Hi there,


Thank you for your inquiry. Just to let you know our support team have a short break early this week but rest assured your issue will be look into as soon as they return.

Thanks,

Hi,

Thanks for reply. I tried Aspose.pdf for .Net 9.7.0 dll. But its also not working. I am creating window 8 app. I need dll that I can use in my window 8 app. Please provide me any dll that can work in Window 8 apps.

Hi Anand,


Thanks for sharing the details.

Aspose.Pdf for .NET is compatible with .NET Framework 4.5 and .NET Framework 4.5.1 but I am afraid currently its not supported with Windows apps store (Windows 8 and RT). However for the sake of correction, we already have logged an investigation ticket as PDFNEWNET-34715 in our issue tracking system. We will further look into the details of this requirement and will keep you posted on the status of correction. Please be patient and spare us little time.

We are sorry for this inconvenience.

Is this feature released now ?

@seanfitz,
It is not resolved yet and dependent on an internal feature. We will let you know once a significant progress has been made in this regard.