Quoting ray <[EMAIL PROTECTED]>:
> Hello:
> I have a question about PDF file size .
Please post your questions to [EMAIL PROTECTED]
> /* part of my code begin */
> Document document = new Document(PageSize.A4, 50, 50, 50, 50);
> PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
> document.open();
> com.lowagie.text.Image jpg =
> com.lowagie.text.Image.getInstance("test.jpg");
> document.newPage();
> document.add(jpg);
> document.close();
> /* part of my code end */
> I use this code to create a test.pdf and the test.jpg is scan from my scanner
So you have a valid PDF file with a JPEG image that is
inserted into the file LITERALLY (the binary of the image
is copied into the PDF).
> but the pdf's size is 121 KB .... I scan the same page from another scanner
> which can scan to a pdf file . It's size is only 57.3 KB .
In the second PDF the Image is probably not added as a JPEG.
Images come in different forms, you know...
> some friends tell me PDF can be compressed
This is true, but not relevant for you.
Your question is about compression of Images,
not PDF.
> I don't know how to do by the iText Lib . can you help me ?
Don't store the result from your first scanner as a JPEG,
but in some other format PNG, GIF,...
You will see that all the different results have different
sizes. Use the resulting format that compresses your image
in the most optimal way.
Bruno
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions