Hey guys,
I've read the chapter on using fonts repeatedly and I'm still really
confused.
I have three TTF fonts that are custom (they contain logos). Obviously,
I need to embed these into the PDF. I also need to be able to get their
"BaseFont" so I can position them absolutely.
I seem to be registering my fonts correctly:
logger.info("registering required fonts:");
String[] fonts = new String[]{"CREDITCARD.ttf",
"OCRAEXT.ttf", "PURDUE.ttf", "SCORECARD.ttf"};
for(String font:fonts){
logger.info("fonts/" + font);
FontFactory.register("fonts/"+font);
}
for (Iterator i =
FontFactory.getRegisteredFonts().iterator(); i.hasNext(); ) {
System.out.println((String) i.next());
}
Gives me this:
main 16:43:06,714 INFO Driver (<init>:18) - registering required fonts:
main 16:43:06,714 INFO Driver (<init>:21) - fonts/CREDITCARD.ttf
main 16:43:06,761 INFO Driver (<init>:21) - fonts/OCRAEXT.ttf
main 16:43:06,761 INFO Driver (<init>:21) - fonts/PURDUE.ttf
main 16:43:06,761 INFO Driver (<init>:21) - fonts/SCORECARD.ttf
times-italic
helvetica-bold
courier-boldoblique
ocraextended <--- mine
helvetica-boldoblique
helvetica
creditcard <--- mine
courier-bold
courier-oblique
zapfdingbats
scorecard <--- mine
times-roman
symbol
purdue <--- mine
helvetica-oblique
times-bold
courier
times-bolditalic
ocr a extended
now that it's registered I need to do something like this:
BaseFont myFont = BaseFont.createFont([what goes here?],
BaseFont.CP1250, true);
PdfTemplate logo = PdfTemplate.createTemplate(..some writer.., 115f,
72f);
logo.beginText();
logo.moveText(1, 20);
logo.setFontAndSize(pefcuFont, 14);
logo.setColorFill(PEFCU_LOGO_RED);
logo.showText("A");
logo.endText();
logo.beginText();
logo.moveText(1, 20);
logo.setFontAndSize(pefcuFont, 14);
logo.setColorFill(PEFCU_LOGO_GRAY);
logo.showText("B");
logo.endText();
help!
Jason
The PEN is now mightier than the PIN. Simply use your PEN
instead of your PIN and sign for your PEFCU Visa Check Card
purchases. Earn bonus points redeemable for gift and travel
awards. Combine PEFCU Visa check card and credit card points
for even more rewards.
***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.***
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questionsBuy the iText book:
http://www.1t3xt.com/docs/book.phpCheck 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/