I'm from Pland and i need to use Polish letter that's way I want to change
default font in AcroFields.
For eg.
DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
Document doc = docBuilder.parse(new File(nazwa_xml));
String xmlData;
PdfReader reader;
HashMap fields;
reader = new PdfReader(input_file_name);
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(output_file_name));
//I'd like to use this font in AcroFields insted of default font
BaseFont helv =
BaseFont.createFont("c:/eBiz/webtomcat/broker/src/main/resources_nofiltering/fop/COURBD.ttf",
BaseFont.CP1250, BaseFont.NOT_EMBEDDED);
AcroFields form = stamper.getAcroFields();
form.addSubstitutionFont(helv);
fields = form.getFields();
String key, appSet = "//appSet/";
for (Iterator i = fields.keySet().iterator(); i.hasNext();) {
key = (String) i.next();
if (condition) {
xmlData = XPathAPI.eval(doc, appSet + key).str();
form.setField(key, xmlData);
}
}
stamper.setFormFlattening(true);
stamper.close();
}
Could somebody help me with this one ?
--
View this message in context:
http://www.nabble.com/How-can-I-change-default-font-in-AcroFields---tp17423686p17423686.html
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar