AcroForm fields with OpenType font?

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for Java (v5.x)  /  Display Thread

DynamicPDF Generator for Java (v5.x) Forum

 Jan 24 2011 6:32 PM
Hi,

I've read that AcroForm fields can only use the Core fonts in this version of DynamicPDF.  Can OpenType fonts be used in the new version (6.0)?

Thanks,

Chris McKinnon
Posted by a ceTe Software moderator
Hello Chris,

Yes, you can use any TTF and OTF fonts to set to the form fields using our version 6 DynamicPDF for Java product. You will have to create a OpenTypeFont object using the required font file and then use the font object to set it to the form filed using setFont method of the field by accessing it using it full name. Below is the sample code for it.

            MergeDocument document = new MergeDocument("C:/Temp/Test.pdf");
            OpenTypeFont fontObj=new OpenTypeFont("C://Windows/Fonts/Verdana.ttf");
            document.getForm().getFields().getFormField("FormfieldName").setFont(fontObj);

Please feel free to download BETA edition of version 6 DynamicPDF for Java product from our website at:
http://www.DynamicPDF.com/Products/DynamicPDF/Beta.csp. Also refer the sample examples downloaded with the product download.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 1:42 PM.