Compress a PDF (in Mbs) to smaller size(in Kbs) in .net

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
roshan1109
Posts: 1
Joined: 2017-04-29T20:45:22-07:00
Authentication code: 1151

Compress a PDF (in Mbs) to smaller size(in Kbs) in .net

Post by roshan1109 »

Hi Team,

I am using ImageMagic dll. I have a simple need.

I have a PDF generated by my system, which is around 2.9MB but I want to compress it down to not more than 500kb. Can I get a approach on the same from the team here?

TIA,

Roshan
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compress a PDF (in Mbs) to smaller size(in Kbs) in .net

Post by snibgo »

What version IM? I assume v6.

IM is a raster image processor. It can read PDF files, but converts them into raster (pixel) images. So it can do the job, but you may not like the result.

I don't use Magick.net. I suggest you prototype with a command first.

Code: Select all

convert input.pdf -format JPG -quality 10 output.pdf
The result may be a small file, but horrible quality. Increase the "-quality" setting towards 100 for better quality but larger files.
snibgo's IM pages: im.snibgo.com
Post Reply