Hi there,
Thanks for your patience. We have tested the scenario and noticed that the issue is caused by Acro form structure. Principal_Name and some other fields have child sub-annotations, each annotations has it's own Flags and field itself does not have flag. So please update your code as following to accomplish the task:
Document pdf1 = new
Document("39063.pdf");
Aspose.Pdf.Facades.Form
pdfForm = new Aspose.Pdf.Facades.Form(pdf1);
foreach (Aspose.Pdf.InteractiveFeatures.Forms.Field field in
pdf1.Form.Fields)
{
int flags = (int)field.Flags;
if (field.Count > 0)
{
int index = 1;
foreach (WidgetAnnotation
subField in field)
{
flags = (int)subField.Flags;
Console.WriteLine("Sub
field " + index);
index++;
if ((flags & (int)AnnotationFlags.Hidden) != 0)
{
Console.WriteLine("hidden");
}
else
Console.WriteLine("visible");
}
}
else
{
if ((flags & (int)AnnotationFlags.Hidden) != 0)
{
Console.WriteLine("hidden");
}
else
Console.WriteLine("visible");
}
//field.Flatten();
string fieldFullName = field.FullName;
FormFieldFacade facadeField = pdfForm.GetFieldFacade(fieldFullName);
Aspose.Pdf.Facades.FieldType
fieldType = pdfForm.GetFieldType(fieldFullName);
//pdfForm.FillField(fieldFullName,
"44.name_vorname");
Console.WriteLine("field
FullName: {0} page: {1} flags: {2}",
field.FullName, facadeField.PageNumber, (int)flags);
}
Please feel free to contact us for any further assistance.
Best Regards,