Andreas Schmidt wrote:

> I guess that I want to create my PDFs with PDFGraphics2D is clear.

No, it isn't clear why you want to use PdfGraphics2D.
If you are the so called 'John Smith' from news://comp.text.pdf
you have an existing PDF document with images, I can't understand
what this has to do with PdfGraphics2D.
Maybe you aren't the 'John Smith' from news://com.text.pdf
and in that case you got me confused by asking a very similar question.

> I am basically using this g2d-Graphics2D-Object to paint Text and 
> Images on it.

OK.

> Well, let's say in the pdf there is an image the size of a 
> square-inch. When I created this image in the pdf I drew a 8 MegaPixel 
> BufferedImage with g2d.drawImage(image, ..., ...). This means this 8 M 
> Pixel image will be in a square-inch on paper...

OK.

> To get a good print 300 dpi is enough for me - so 8 M Pixel in a 
> square-inch is much more then 300 dpi.

I see.

> Well I could simply scale down the 8MPixel Image to 1 M Pixel before I 
> use the g2d.drawImage(...) method. 

Using JAI or another Java library/class.

> I just wondered if this could be done directly by iText - 

Yes, but not like this:

> I would like to specify a maximal resolution ( e.g. 300 dpi),

If you want to specify a resolution, you need another tool.

> and iText would do the down-scaling for me (I don't want too big pdfs 
> - size does matter).

iText can change the images into a Jpeg with a certain quality
if you create your Graphics2D object using this method:
http://itextdocs.lowagie.com/docs/com/lowagie/text/pdf/PdfContentByte.html#createGraphics(float,%20float,%20boolean,%20float)
The quality parameter is a float between 0f (0%) and 1f (100%).
By converting all images to Jpegs and choosing a quality of for instance 
0.1f
you will see that the file size will be reduced enormously.
Of course this is a completely different approach that doesn't answer
your 'resolution' question.
br,
Bruno


_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to