i'm trying to get the field page in my project,
and i dont know how to get the page number for each field and field.
i have this code:
String formTemplate = "Template.pdf";
String filledForm = "filledForm.pdf";
PDDocument pdfDocument = PDDocument.load(new File(formTemplate));
PDAcroForm acroForm = pdfDocument.getDocumentCatalog().getAcroForm();
if (acroForm != null)
{
PDField field = acroForm.getField( "name" );
field.getAcroForm().setNeedAppearances(true);
field.setValue("my name");
acroForm.getField( "date" );
field.setValue("my date");
}
pdfDocument.save(filledForm);
pdfDocument.close();
}
How do I get the page numbers of the fields?
thanks
ron
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…