Dear TVT,

Thanks for Reply. Some of the pdf's contains images and text and some of them are contains plain text some of them both. So, what ever the pdf's content I want to compress it to KB's and quality should be 70%-80%.


On Tue, Jul 8, 2014 at 8:48 PM, TvT <tvtreeck@nepatec.de> wrote:
Ok Suresh,

that is not possible. Some pdfs do not contain any images, nor any unused objects - size reduction is not possible in that case even if the pdf is 200 MB.
I am guessing you want to reduce the size of Pdfs which mostly (or only) contain images (e.g. PDFs created from a scanner etc).
You want to reduce the quality of the contained images so that the final size will be much smaller...?

You need to be more specific here...



2014-07-08 17:09 GMT+02:00 Suresh Amsala <sureshinfo250@gmail.com>:

Dear Leonard Rosenthol,

I didn't try using Adobe Acrobat but i want to do through programmatically not manually why because that is not a fixed size it may vary and the files should be uploaded by users.

The quality should maintain 70%-80% compare to original pdf.The remaining things I don't mine like fonts,headers etc.


On Tue, Jul 8, 2014 at 8:25 PM, Leonard Rosenthol <lrosenth@adobe.com> wrote:
Did you try using Adobe Acrobat (even a trial version) to see if it can reduce the size of your PDFs?  Depending on what is in there, and what options are important to you (embedded fonts, high quality images, etc.) it may not be possible to reduce the size.

Leonard

From: Suresh Amsala <sureshinfo250@gmail.com>
Reply-To: Post here <itext-questions@lists.sourceforge.net>
Date: Tuesday, July 8, 2014 at 10:45 AM
To: Post here <itext-questions@lists.sourceforge.net>
Subject: Re: [iText-questions] [SPAM] Re: Reduce PDF file size

I am uploading 20 MB pdf file it contains images and text and i want to compress this file size to bellow 1 MB using iTextSharp in C#.

How to do this? I tried TVT's Sample code but the file does not compressing I mean the file size is same before uploading and after uploading.


On Tue, Jul 8, 2014 at 5:04 PM, TvT <tvtreeck@nepatec.de> wrote:
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 <mkl@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



--
Thanks and Regards
Amsala Suresh
9966151913

------------------------------------------------------------------------------
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



--
Thanks and Regards
Amsala Suresh
9966151913

------------------------------------------------------------------------------
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



--
Thanks and Regards
Amsala Suresh
9966151913