I would like to change default font of every field in an existing PDF
form.This suggests to me that I should change the default appearance of the
acroform and, so be on the safe side (since I am not the author of these
forms), change the default appearance of each PDTextField (I don't care
about choice fields &c.)

All of the examples that I have been able to find of changing field
appearances are PDFBox 1.8 examples that  get the COS Dictionary, mess
around with it and reset the field dictionary AND THEN CREATE A NEW
INSTANCE OF THE FIELD (e.g. java - How to set the text of a PDTextbox to a
color? - Stack Overflow
<http://stackoverflow.com/questions/22073137/how-to-set-the-text-of-a-pdtextbox-to-a-color/22082301#22082301>),
which presents me with practical and aesthetic problems. The explanation
given for this is 'The field variable has to be renewed in between because
`PDVariableText` stores the default appearance in a hidden member during
initialization'. I would really like to avoid doing this if I don't have to.

I would think that, in 2.0, I could get away with something like:


*     field.setDefaultAppearance("/Helv 0 Tf 0 g");*

Can I get away with just that? Or do I need to create a new field instance?
-- 
*Evan Williams*
Sr. Software Engineer
[email protected]

*www.ZappRx.com <http://www.zapprx.com/>*

Reply via email to