IText 7,PdfFormField内部的文本对齐?

时间:2017-10-02 16:09:03

标签: itext7

我试过这个问题,但没有运气。

这就是我的尝试。

using (PdfDocument doc = new PdfDocument(new PdfReader(template), new 
PdfWriter(newPath)))
{
    PdfAcroForm form = PdfAcroForm.GetAcroForm(doc, true);

    // Replace form fields with correct data
    form.GetField("Greet").SetValue("Hello world!");    


    // I have tried this to with no luck
    form.GetField("Greet").SetJustification(1).SetValue("Hello World");

    form.FlattenFields();
}

1 个答案:

答案 0 :(得分:0)

Pdf不支持acro-forms的理由。 所以这不是iText问题。该规范根本不允许它。