See 
http://itextdocs.lowagie.com/tutorial/objects/images/index.html#transformations.
 
There's also no guarantee that getDpi will return anything.

Paulo

----- Original Message ----- 
From: "nitm" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 04, 2007 5:01 PM
Subject: [iText-questions] resizing images.


>
> hi all.
>
> my application connects to a db and read orders from it.
> each order contains an image and its width and height (in cm).
>
> i'm trying to resize the image so it will be printed in the same size as
> stored in the order.
>
> here's what i did:
> Image bgimg = Image.getInstance(imgurl);
> float width, height;
> width = new Float(m_pattern.getWidth() * bgimg.getDpiX() / 2.54);
> height = new Float(m_pattern.getHeight() * bgimg.getDpiY() / 2.54);
> bgimg.scaleAbsolute(width, height);
> document.add(bgimg);
>
> in the pdf that i get from this the image is larger than it should be.. 
> it's
> even larger than the original size.
>
> any ideas?
>
> thanks!
> -- 
> View this message in context: 
> http://www.nabble.com/resizing-images.-tf3526406.html#a9839122
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> 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/ 


-------------------------------------------------------------------------
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/

Reply via email to