tags:

views:

170

answers:

1

I have a pdf that is around 4MB in size. When I open it in Adobe Acrobat (version 8) and go to File -> Save as the resulting pdf is only 137KB.

This pdf is 67 pages big, each page looking very similar to the other, with only some numbers changed: same background, same fonts, almost same text, ... It has been created using Cete DynamicPDF Merger from individual pdf files.

What I think could be a possible cause are the fonts: when I check file->properties and look at the Fonts tab I see that the same font has been included multiple times in it. The new pdf that Acrobat saves only has that font once.

Is there a tool (preferably a .NET library) that would allow me to compress pdf's files like that one similar like Acrobat does?

+1  A: 

You may try with iTextSharp. I've been using it for a long time and I'm satisfied with the resulting PDF size:

Document.Compress = true;
var reader = new PdfReader("input.pdf");
using (var output = File.OpenWrite("output.pdf"))
{
    new PdfStamper(reader, output).Close();
}
Darin Dimitrov
I've just tried out iTextSharp, but without much luck:1) I tried that code sample but the resulting pdf isn't really much smaller2) I've tried to use iTextSharp to merge the pdf files together instead of using the merger from CeTe software, but I don't notice any decrease either.
Simon