Get some checkbox field properties from a Dynamic PDF file

okaizi:
Yes. For the second problem( PDFNEWNET-39566) , I have also tried many different PDFs, in most cases, PageIndex = 0 occurs with a RadioButtonField (and in my code it is not an exception but only makes PageIndex = 0).
Hi Arashi,

Thanks for sharing the details.

As stated earlier, during my testing, I managed to get the exception mentioned earlier and team will further look into this problem from this perspective. Can you please share some sample project which can help us in reproducing PageIndex = 0 issue instead of exception.

okaizi:
As for the first problem, I think there is a way to work around it temporary. Now, it only happens to a RadioButtonField with at least one RadioButtonOptionField , and every RadioButtonOptionField has a valid AnnotationIndex. Thus I can choose any of the RadioButtonOptionFields to represent Annotation index of that RadioButtonField. This works fine for me so far. So I was wondering if the second problem is also related to some codes in RadioButtonOptionField/RadioButtonField?
From first problem, do you mean PDFNEWNET-39170 reported earlier ? Please explain so that we can share further details.

okaizi:
And by the way, we have RadioButtonOptionField for RadioButtonField. Are there any similar fields (something like CheckBox***Field)? Thanks!
Like other form fields, you may also add CheckBox filed over PDF document.

Hi Arashi,


Thanks for your patience.

The product team has further investigated the issue PDFNEWNET-39170 reported earlier and as per our observations, your document contains static XFA form. That’s why its fields may be accessed both via Document.Form (as for standard form), and via XFA. Therefore you need to take into consideration that form has hierarchical structure and that’s why it requires recursive scan of the field. If field contains subfields they should be iterated.

Sample code:
[C#]

private void ScanFields(string rootName, Field
field)<o:p></o:p>

{

foreach (Field subField in field)

{

//if this field does not contain subfield, it is "terminal" field and we should get its type and value.

//RadioButton field is "special case", it contains subfiels (we can access to every radio button option as different field) but we should query value from RadioButton field in order to check which exactpy option is checked.

if (subField.Count == 0 || subField is RadioButtonField))

{

Console.WriteLine(rootName + "." + subField.PartialName + " type = " + subField.GetType() + " value = " + subField.Value);

}

//else we call this method recursively for each subfield.

else

{

ScanFields(rootName + "." + subField.PartialName, subField);

}

}

}

public void ShowFields()

{

Document doc = new Document("RadioButtons.pdf");

foreach (Field field in doc.Form)

{

ScanFields("", field);

}

}


From other hand, you may access to fields via XFA. In order to determine field type customer should check field template which may be get with GetFieldTempate method.

Field template is XML which have the following form <$fieldtype>… </$fieldtype> where $fieldtype is one of field types, for example textEdit, checkBox etc.
For example …
[C#]

Document doc = new
Document(“RadioButtons.pdf”);<o:p></o:p>

foreach (string field in doc.Form.XFA.FieldNames)

{

XmlNode tmpl = doc.Form.XFA.GetFieldTemplate(field);

Console.WriteLine(field + " type = " + tmpl.ChildNodes[0].ChildNodes[0].Name + " value = " + doc.Form.XFA[field]);

}

Hi,

Nayyer:

As stated earlier, during my testing, I managed to get the exception mentioned earlier and team will further look into this problem from this perspective. Can you please share some sample project which can help us in reproducing PageIndex = 0 issue instead of exception.

Yes, I looked through my code again, it will produce an exception, PageIndex =0 is because of error handling block in our code, sorry about the confusion.

Nayyer:

From first problem, do you mean PDFNEWNET-39170 reported earlier? Please explain so that we can share further details.

The first problem means this one as mentioned in my earlier post:

https://forum.aspose.com/t/28488

(PDFNEWNET-39216). I can work around as talked in my previous post.

okaizi:
Nayyer:

As stated earlier, during my testing, I managed to get the exception mentioned earlier and team will further look into this problem from this perspective. Can you please share some sample project which can help us in reproducing PageIndex = 0 issue instead of exception.

Yes, I looked through my code again, it will produce an exception, PageIndex =0 is because of error handling block in our code, sorry about the confusion.

Hi Arashi,

Thanks for the acknowledgement. In case we can be of any further assistance, please do let us know.

okaizi:
Nayyer:
From first problem, do you mean PDFNEWNET-39170 reported earlier? Please explain so that we can share further details.
The first problem means this one as mentioned in my earlier post:

https://forum.aspose.com/t/28488

(PDFNEWNET-39216). I can work around as talked in my previous post.

Since the issue is already discussed in other forum thread, so in order to avoid the confusion, we can discuss the status in other forum thread. In the event of any further query, please feel free to contact.

Hi, is there any update on these?

Hi Arashi,


Thanks for your patience.

As we recently have noticed the issue PDFNEWNET-39566, so its still pending for review. Please note that the team has been busy fixing other previously reported high priority issues and above stated issue is still not resolved. As soon as we have some definite updates regarding its resolution, we will let you know.