Sam Green wrote: > Hi all, > > I have a quick question about image resolution with iText: > I have a png image of high quality, that I am adding to my PDF document > using Image.getInstance( filename ). When I do this, I notice a huge > drop in image quality.
iText doesn't downsize images. The > I'm assuming that iText is sampling my original image at 72dpi (the > impression I get from that documentation). Is there a way of increasing > this? Please read the tutorial, look for 'Scaling': http://itextdocs.lowagie.com/tutorial/objects/images/#transformations > The only way I can see of getting better quality images at the moment is > to create the original images twice as large, and then scale them down > in iText. Unfortunately, this is impractical, as the images are being > generated via another API that scales a bunch of text objects in > different ways. Too bad... In the book there an example that retrieves the image resolution, and scales the image accordingly: http://itext.ugent.be/itext-in-action/examples/chapter05/FoxDogImageScaling2.java This won't work for all images found in the wild... br, Bruno ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
