There are several options but mkl is right: You need to be certain that
there are unused things in your pdf.
To get an idea whats possible try the following two options in adobe
acrobat:
"File > Save As > Optimized PDF...", and "File > Save As > Reduced Size
PDF...".
In iText you got several options:
- enable compression
- remove unused objects
- remove fields, annotations etc. if you don't need those anymore
However you need to be more specific about your situation. Maybe you merged
two PDFs and didn't used PdfCopy instead of PdfSmartCopy - who knows?
Still some code which shows some of the stuff:
PdfStamper stamper = new PdfStamper(reader, fs,
PdfWriter.VERSION_1_5);PdfWriter writer = stamper.Writer;
writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_5);
writer.CompressionLevel = pdf.PdfStream.BEST_COMPRESSION;
reader.RemoveFields();
reader.RemoveUnusedObjects();
stamper.Reader.RemoveUnusedObjects();
stamper.SetFullCompression();
stamper.Writer.SetFullCompression();
stamper.Close();
2014-07-08 12:42 GMT+02:00 mkl <m...@wir-sind-cool.org>:
> Amsala Suresh,
>
> Suresh Amsala wrote
> > I want to compress a *PDF file size from MB's to KB's* (if the file size
> > is 5 MB then it should be compressed in to KB's like 500 KB or 600 KB).
>
> What information in those PDFs is superfluous in your context and can be
> thrown away?
>
> Regards, Michael
>
> PS: Knowing nothing about the PDFs in question it is hard to tell whether
> or
> not they can be compressed at all. There of course are some techniques like
>
> * replacing images with lower-resolution or lower-quality replacements (but
> you have not told us whether there are images in those PDFs and whether
> they
> may be downgraded);
> * removing embedded fonts if you know they are available to the target
> audience PDF viewers and provide the required information (but you have not
> told us whether there are such embedded fonts);
> * re-compressing the streams at highest compression setting and switching
> to
> object streams (but the files may already use those settings);
> * hunting for duplicate objects like identical header images included
> separately in the file (but you have not indicated whether there are such
> duplicates)...
>
>
>
> --
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/Reduce-PDF-file-size-tp4660118p4660119.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php