Bruno Lowagie wrote:
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
Yet there was a drop in quality... what could explain this?
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
I'm talking about the sampling resolution, not the resolution of the
image on the PDF canvas. I could make the image infinitely small, and
so give it infinite resolution, but that wouldn't help me.
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...
My PNG file is vector based, to presumably it is possible to sample this
at a greater resolution. Is there no way of doing this? It seems a
bit backward for me to have to make an image twice as big in order to
get twice the resolution.
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/
Thanks for your help 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/