In iText in Action (great book, by the way, but I wish it had javadocs for all the classes as an appendix) , Chapter 5, it talks about image resolution (page 153 in my book). "For images, iText always uses a resolution of 72 dots per inch (dpi), regardless of the resolution specified inside the image.... If you want the object to be displayed as an image of [original size], you need to scale it..... By default, iText shows the image with a resolution of 72 dppi, but you can change this by scaling it: .... tiff.scalePercent(72f / tiff.getDpiX() * 100);"
This is exactly what I need, but getDpiX() and getDpiY() both return 0, which is mentioned as an aside in this post: http://itext-general.2136553.n4.nabble.com/resizing-images-td2150717.html#a2150717 How can I scale my images if there's "no guarantee that getDpi will return anything"? (My images are currentlyl appearing larger in the PDF than the original size) Thanks! -- View this message in context: http://itext-general.2136553.n4.nabble.com/Scaling-images-when-getDpiX-returns-zero-tp2228877p2228877.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
