We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Adobe fields do not extract for some documents

Hi,

Environment Aspose.pdf_10_3_0 and Aspose.pdf_10_9_0. Language is c#

I have attached two documents. adobe_fields_document.pdf works fine to iterate over non-zero fields. But NewHire1.pdf has adobe fields and the count of fields is 0(pdfDocument.Form.Fields count= 0).

//Step 1: Get all Adobe fields.
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filename);

Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(pdfDocument);

//get all field names
String[] allfields = form.FieldNames;

Aspose.Pdf.InteractiveFeatures.Forms.FormType formType = pdfDocument.Form.Type;
string fieldFullName = “”;
Aspose.Pdf.Facades.FormFieldFacade fieldfacade = null;
FieldType fieldType = 0;//default to Text type


foreach (Aspose.Pdf.InteractiveFeatures.Forms.Field formField in pdfDocument.Form.Fields) // pdfDocument.Form.Fields count = 0
{
/// rest of the code…
}

1. Why did it fail for NewHire1.pdf? Is there another way to extract its form fields?
2. Why does the code work for some documents and not for others? Is there a way to catch such non-working use cases?

Thank you,
Sireesha

Hi Sireesha,


Thanks for your inquiry. We have tested the scenario and noticed that API is not identifying the form field and even Adobe Acrobat as well. However we have logged an investigation ticket PDFNEWNET-39541 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

Hi Sireesha,


Thanks for your patience. We have investigate the issue and fount that your shared document does not contain any field. It contains annotations which may be enumerated using for example the following code:

foreach(Annotation annot
in doc.Pages[1].Annotations)<o:p></o:p>

{

... (process annotation)

}

Please feel free to contact us for any further assistance.


Best Regards,