Hi Guys,
This isn't directly a iText issue, but since I'm sure many of you have come
across it, I'm hoping someone has a solution, as I can't find one online. After
several suggestions here I've begun storing logos (mostly line art) in the form
of png files. The problem is all the methods I see of scaling and saving png's
involve BufferedImage which reduces everything to 72dpi! Even if I immediately
save the image I'm reading in, it gets reduced. I've been using the method
discussed here:
http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
for scaling which works better than just using Graphics2D like I was before.
How are you guys scaling images and saving them so that they can be added into
iText later, and keeping them at a resolution higher than 72dpi?
Here's a simplistic example, reading in 450dpi, becomes 72dpi.
originalBufferedImage = ImageIO.read("MyImage.png");
// Save the original image directly to file so we can test it
File destFile = new File("OriginalLogo.png"); // where you want it.
ImageIO.write(originalBufferedImage, "png", destFile);
Thanks in advance.
Dominic
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar