I am using iText API to generate RTF using Java. The RTF file is generated fine but one requirement is adding a barcode. What i did is:
FontFactory.register("c:\\windows\\fonts\\FREE3OF9.ttf", "Free 3 of 9 Extended");
return FontFactory.getFont("Free 3 of 9 Extended",20, Font.NORMAL, Color.BLACK);
I tried loading other fonts; that was working fine, but it doesn’t work when I use the barcode font (FREE3OF9.ttf).
The RTF file is generated but the the “Font name” looks like “New” instead of “Free 3 of 9 Extended” in MS Word when I open it. When I select the words and choose the font name, the barcode appears fine.
I think there is a problem with Free 3 of 9 Extended Font.
Odd. I don’t really have The Answer, but I can certainly offer some advice.
getFont(...). It’s entirely possible that the problem is in registration, and you’re just getting back a default font. I don’t see why it’d be called “New”, but definitely worth checking.The source link is to iText v2.1.7, the last version that supported RTF. The guy who worked on it vanished into the web some time prior to that, so we stopped supporting it with 5.0 (along with the licensing change, package rename, and so forth).