On Monday 14 May 2007, Thomas Bickel wrote:
>       if((itImg.width() > docWidth) || (itImg.height() > docHeight)) {
I missed it the first time I read through your code, but when I ran it now, I 
caught the error. In this line you are mixing pixels and points. 
itImg.width() returns the width of the image in pixels, while docWidth is 
calculated in points and 1px = 1.33pt. So comparing 1px = 1pt means that the 
code thinks the image is to large to early and then calls the scaling code. 
The scaling code works correctly, because you feed it docWidth and docHeight 
(both in points) and the scaleToFit method expects user units (for RTF 
points).

Greetings,
Mark
-- 
Save energy: be apathetic.

My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc

Attachment: pgp3akHVMPOio.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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/

Reply via email to