cancel
Showing results for 
Search instead for 
Did you mean: 

How to compress file size from 3-4MB to less than 2 MB

vinodchinthakin
Level 9
Hi All,

I got a requirement to compress PDF file size to less than 2 MB. That particular file usually be more than 3-4 MB. Any possible way to compress it using any code stage or any other way to achieve it?
Please suggest me if there is any way to do it.

Thanks in Advance.

------------------------------
vinod chinthakindi
------------------------------
8 REPLIES 8

ewilson
Staff
Staff
There's a VBO on the DX for this.

https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---windows-compressed-file-2

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson. I want to reduce file size of PDF. The output format should be PDF only. By using above VBO, I can just compress into Zip.
I Found a solution for that. There is an option in Adobe reader to reduce size file, which I was able to automate PDF Reader using global send keys.
I was looking for any code for that without depending on any application.

Thanks​​​

------------------------------
vinod chinthakindi
------------------------------

Hi Vinod,

you might need to make use of external libraries to achieve what you are trying to do iTexSharp is a good library but compression ratio is less 

SPIRE.pdf is a good one  you can get the dll from here https://www.nuget.org/packages/Spire.PDF/ and examples are available in https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Document-Operation/How-to-Compress-PDF-Document-in-C-VB.NET.html

do it on your own risk 🙂 sometimes we will have to think out side of the box to get what is needed

------------------------------
Jerin Jose
Technical Product Owner
EY
Asia/Kolkata
*"If you find this post helpful mark it as best answer, .*
------------------------------

Hi Jerin.
By using ITextsharp, I think after compressing file output will be in Zip format not into pdf format. I found Spire.pdf at early stages, but I am looking for any code or VBO internally.
If I couldn't able to find anything then I will go with Spire.pdf

Thanks for the response.

------------------------------
vinod chinthakindi
------------------------------

Ok, Adobe's PDF Services supports compression of the PDF. The Blue Prism PDF Toolkit, available on the Digital Exchange, includes an action for this feature. However, there's a cost associated with using Adobe's Document Cloud. You can trial it for free, but eventually you'll have to start paying.

I'm not aware of any free/open source libraries that implement PDF compression.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

There is a utility available online called Ghostscript. I've seen some articles that state it can be used to compress a PDF, but this seems to be hit-or-miss depending on the content of the PDF. You can find Ghostscript here. It is open source and there is a Windows version.

Then you can take a look at this page on GitHub for an example of the command line parameters you'd need to pass into it.

NOTE: I have NOT tested this myself. Tread cautiously.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson.
What is the value I need to provide in CredentialsFilePath​ data item. which credentials I need to provide.
Could you pls tell me from where I can download this DLL Adobe.PDFServicesSDK.dll which is required for this Blue Prism PDF Toolkit, VBO.

Thanks

------------------------------
vinod chinthakindi
------------------------------

@vinod chinthakindi,

I believe all your questions are answered in the User Guide that's available with the asset on it's DX page.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------