Have a look:

http://api.itextpdf.com/com/itextpdf/text/Phrase.html

&

http://api.itextpdf.com/com/itextpdf/text/Font.html

The documentation is your friend.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: Jason Berk [mailto:[email protected]] 
> Sent: Tuesday, September 14, 2010 1:14 PM
> To: Post all your questions about iText here
> Subject: [iText-questions] get font color from phrase
> 
> How do I get the color of a font used to create a phrase?
> 
> // in the statement decorator
> Phrase footer = new Phrase(String.format(FOOTER, phone, 
> email), Fonts.RED); statement.addPhrase(footer, 130, 275f);
> 
> // in the statement class
> public void addPhrase(Phrase phrase, float x, float y) {
>       String text = phrase.getContent();
>       canvas.saveState();
>       canvas.setColorStroke(Colors.BLACK);
>       // fails - canvas.setColorStroke(phrase.getFont().getColor());  
>       // phrase.getFont().getColor() returns null
>       canvas.beginText();
>       canvas.moveText(x, y);
>       canvas.setFontAndSize(phrase.getFont().getBaseFont(),
> phrase.getFont().getSize());
>       canvas.showText(text);
>       canvas.endText();
>       canvas.restoreState();
> }
> 
> ***This is a transmission from Purdue Employees Federal 
> Credit Union (PEFCU) and is intended solely for its 
> authorized recipient(s), and may contain information that is 
> confidential and or legally privileged.  If you are not an 
> addressee, or the employee or agent responsible for 
> delivering it to an addressee, you are hereby notified that 
> any use, dissemination, distribution, publication or copying 
> of the information contained in this email is strictly 
> prohibited. If you have received this transmission in error, 
> please notify us by telephoning (765)
> 497-3328 or returning the email. You are then instructed to 
> delete the information from your computer.  Thank you for your
> cooperation.***
> 
> 
> --------------------------------------------------------------
> ----------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> 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/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.851 / Virus Database: 271.1.1/3131 - Release 
> Date: 09/13/10 23:35:00
> 

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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/

Reply via email to