What am I supposed to see? Post working code and the result that you
expect. 

> -----Original Message-----
> From: Andreas Meyer [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 04, 2005 2:59 AM
> To: Paulo Soares
> Cc: [email protected]
> Subject: Re: RE: RE: [iText-questions] middle align 
> background image with text
> 
> Scaling is 24% and I get the same unexpected result with both 
> approaches
> (enlarged part of screenshot attached, please only pay 
> attention to vertical
> alignment).
> 
> 
> > writer.getDirectContentUnder().addImage(img, 
> img.scaledWidth(), 0, 0,
> > img.scaledHeight(),
> > rect.left() + rect.width()/2 - img.scaledWidth()/2,
> > rect.bottom() + rect.height()/2 - img.scaledHeight()/2);
> > 
> > It may not work if scaling is not 100% or with rotation. A 
> better way
> > is:
> > 
> > img.setAbsolutePosition(rect.left() + rect.width()/2 -
> > img.scaledWidth()/2,
> > rect.bottom() + rect.height()/2 - img.scaledHeight()/2);
> > writer.getDirectContentUnder().addImage(img);
> > 
> > (warning: code not tested)
> > 
> > > -----Original Message-----
> > > From: Andreas Meyer [mailto:[EMAIL PROTECTED] 
> > > Sent: Thursday, March 31, 2005 11:18 AM
> > > To: Paulo Soares
> > > Subject: Re: RE: [iText-questions] middle align background 
> > > image with text
> > > 
> > > 
> > > The text is in the rectangle.
> > > 
> > > writer.getDirectContentUnder().addImage() is part of "public void
> > > onGenericTag()" and the text is marked with 
> > > "myChunk.setGenericTag()" ...
> > > 
> > > Thanks for your help !
> > > 
> > > > Where is the text? 
> > > > 
> > > > > -----Original Message-----
> > > > > From: [EMAIL PROTECTED] 
> > > > > [mailto:[EMAIL PROTECTED] On 
> > > > > Behalf Of Andreas Meyer
> > > > > Sent: Tuesday, March 29, 2005 4:18 AM
> > > > > To: [email protected]
> > > > > Subject: [iText-questions] middle align background 
> image with text
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > I would like to align text precisely in the middle of a 
> > > > > background image. I have
> > > > > tried it this way, but with no luck:
> > > > > 
> > > > > writer.getDirectContentUnder().addImage(img, 
> > > img.scaledWidth(), 0, 0,
> > > > > img.scaledHeight(), rect.left(), rect.bottom() - 
> > > > > ((img.scaledHeight() -
> > > > > rect.height()) / 2));
> > > > > 
> > > > > Can you please tell me whats wrong ?
> > > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by Demarc:
> > A global provider of Threat Management Solutions.
> > Download our HomeAdmin security software for free today!
> > http://www.demarc.com/Info/Sentarus/hamr30
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to