Hi,

I'd like to know how I can reuse a font that is used in a template pdf (after adding the PdfImportedPage)
Using the fontfactory doesn't work, neither does BaseFont.createFont:


FontFactory.getFont("FONTNAME")
BaseFont.createFont("FONTNAME", BaseFont.CP1252, true)

BaseFont.createFont() gives me an error, because of an encoding error or something
(I also tried MacRoman - a report shows me it's encoded in macroman)


After that I downloaded the paolo package to do:

ArrayList embeddedFonts = BaseFont.getDocumentFonts(reader);
for (Iterator iter = embeddedFonts.iterator(); iter.hasNext();)
{
Object[] info = (Object[])iter.next();
if (name.equals((String)info[0]))
{
return BaseFont.createFont((PRIndirectReference)info[1]);
}
}
This returns a list of used fonts, but after doing a document.close() it throws an NPE


I'm sure that the font names are good, because I've checked with a tool, and with the code above.


Thanks.


------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to