Dear Mr. Brandt,
Thanks for considering Aspose.Pdf.Kit.
We totally understood your requirement. You want to obtain the exact fieldname of each field in a huge document with so many fields. The solution depends on the type of the doc, if it is AcroForm PDF, the following code will be fine:
//get all field names
Form form = new Form (path + "Fields.pdf");
String[] allfields = form.FieldsNames;
System.Drawing.Rectangle[] box = new System.Drawing.Rectangle[allfields.Length];
for (int i = 0; i < allfields.Length; i++)
{
FormFieldFacade facade = form.GetFieldFacade(allfields[i]);
box[i] = facade.Box;
}
form.Save();
//add a textfield just upon the original one
FormEditor editor = new FormEditor(path + "Fields.pdf", path + "Fields.out.pdf");
for (int i = 0; i < allfields.Length; i++)
{
editor.AddField(FieldType.Text, "TextField" + i, allfields[i], 1, box[i].Left, box[i].Top, box[i].Left + 50, box[i].Top + 10);
}
editor.Save();
However, if it is a XfaForm PDF, since AddField() is invalid in such environment, you need another workaround. If you are not sure, please attach your file, thanks.
Best regards.
Luke Fu
Product Developer
Aspose Changsha Team
About Us Contact Us