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?
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();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With