我试过这个问题,但没有运气。
这就是我的尝试。
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();
}
答案 0 :(得分:0)
Pdf不支持acro-forms的理由。 所以这不是iText问题。该规范根本不允许它。