Keith O wrote:
>> Do you have idea why it is so and how it can be fixed?
> 
> http://api.itextpdf.com/com/itextpdf/text/pdf/AcroFields.html#setExtraMargin%28float,%20float%29

The method setExtraMargin allows you to compensate for cross-version 
differences of the position of the baseline.

I think this isn't the same problem the OP is talking about. Setting 
"extraMarginTop" will cause an extra top margin for all the text fields, 
also for the fields that aren't defined as multiline text fields.

I interpret the question as: can I define a vertical alignment for 
multi-line text fields, so that it is bottom aligned instead of top aligned?

The answer is: not with AcroFields.setField().
The Y offset of the text is computed based on the height of the field 
widget, the borderwidth, and the extraMarginTop value. As a result, the 
text is vertically aligned to the top.

Is there an alternative? Yes:
http://itextpdf.com/examples/index.php?page=example&id=163

Although the example serves another purpose, the line that is important 
to you, is:

FieldPosition f = form.getFieldPositions(TEXT).get(0);

f.position will give you a Rectangle object with the coordinates you can 
use to add a ColumnText object that puts the text exactly where you want it.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to