David Woosley wrote:

What are the units of measurement inside the com.lowagie.text.Image class?
For example, the scaleToFit(w,h) method accepts two float arguments. It it expecting pixels, points or what? The DvdCover example makes me think this method is accepting points, not pixels. The Java docs for the Image class do not specify the units of measurement. Testing the class has taught me that some methods -- like width() and height() -- always return pixels. When the scaleToFit(w,h) method is called, is the image actually rescaled at that moment? The width() and height() remain the same after calling scaleToFit(w,h), although scaledWidth() and scaledHeight() do change to .... what? Points, pixels? The documentation is not clear on this. Thanks.

The width and height are in pixels.
The scaledWidth and scaledHeight are in user units (points).
iText doesn't take the image resolution into account,
nor does iText 'scale' images in the sense that the resolution gets lost.

What happens is that iText adds the image AS-IS (with the
original number of pixels) into the PDF (technically, into the file).
If you look at the PDF document (visually, at a PDF page),
you will see the image with the size defined in scaledWidth/Height.
Observe that the number of pixels doesn't change when you scale
an image; you only change the resolution.

I hope this answer helps. I always have difficulties explaining this.
br,
Bruno


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to