Align AcroFields in java

后端 未结 1 1587
天命终不由人
天命终不由人 2021-01-22 12:06

I\'m using iTextSharp to populate the data to PDF Templates, which is created in OpenOffice. it populating fine, I\'m getting proper PDF. In that PDF some where summary will com

1条回答
  •  一个人的身影
    2021-01-22 13:05

    Assuming that you have a pure AcroForm and not a hybrid form as I indicated in my comment, this is how you change the quadding of a field:

    AcroFields form = stamper.getAcroFields();
    AcroFields.Item item;
    item = form.getFieldItem("fieldLeft");
    item.getMerged(0).put(PdfName.Q, new PdfNumber(PdfFormField.Q_LEFT));
    item = form.getFieldItem("fieldCenter");
    item.getMerged(0).put(PdfName.Q, new PdfNumber(PdfFormField.Q_CENTER));
    item = form.getFieldItem("fieldRight");
    item.getMerged(0).put(PdfName.Q, new PdfNumber(PdfFormField.Q_RIGHT));
    

    The quadding isn't part of the field flags as you wrongly assumed. It's and entry of the widget annotation dictionary.

    0 讨论(0)
提交回复
热议问题