Andrew Smith wrote:

>Is there something in the itext api to mimic the
>autosize feature that Adobe Acrobat provides for form
>fields? 
>  
>
Yes. If you set the fontsize to 0, the font-size will be adjusted
automatically so that the text fits the text field.
AcroFields form = stamper.getAcroFields();
form.setFieldProperty("field", "textsize", new Float(0), null);

>The problem I have is that my height is too large. The
>fonts always appear too large on the resulting form.
>  
>
Oh, I don't know if this will be fixed by setting the font-size to 0.

>Any characters below or above the line like j's and
>g's are especially problematic. Is there some constant
>adjustment factor I need to scale my font by? Is there
>a better way to go about this?
>
There is a way to adjust the positioning of the text, but it doesn't
scale the font.: form.setExtraMargin(3, 3);
br,
Bruno


_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to