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

Free Support Forum - aspose.com

Annotation.Name vs. Annotation.FullName

Please help me to understand the distinction between Name and FullName.


My primary purpose is to be sure that every annotation I encounter in a form comes with a unique name, which I can use as a look-up key.

Out of caution, I wrote code using FullName, instead of Name. I assumed FullName would, if anything, be more complete than Name.

For many fields, such as text fields, I found the two to be equal.

However, I just learned with RadioButtonOptionFields that Name actually is more specific than FullName. It seems FullName is the name of the RadioButtonField, whereas Name is the name of the RadioButtonField, plus the OptionName. Obviously, since each RadioButtonOption has the same FullName as the RadioButtonField, FullName is not unique. Since Name adds the OptionName to the FullName, the Name property is what appears to make the given annotation/radio button option unique.

Can you briefly explain how Name vs. FullName are assigned for different annotation types? I need to be sure that for any field of any type, I have a unique name.

If you have other advice to add, I’d appreciate it.

Thanks.

Hi Jeff,


Thanks for your inquriy. We are looking into your requirements and will update you soon.

Best Regards,

Hi Jeff,


Thanks for your patience. Please note Name is name of annotation or field itself, it is called PartialName for Field and FullName is name according to field hierarchy. For example if field with partial name “Field1” is placed in a group of fields which is named as “Group1” then full name of the field will be Group1.Field1 and Name(PartialName) is Field1

So you can use FullName for all kind of form fields as it is unique, whereas Name(PartialName) may be same for fields in different Field groups. Furthermore for RadioButton, it has unique FullName but its options are not really field but annotations that are inserted in the PDF page.

Please feel free to contact us for any further assistance.

Best Regards,
Hi, Tilal.

The response you provided does not seem to be the case on my end. I cannot find my Aspose.Total.Net version number, but if you need it, please let me know how to find it.

I have attached a pdf form for you to use to see if you get expected results on your end.

In the attached PDF Form, there are 2 pages. Page 1 has a TextBoxField (Name) and 2 RadioButtonOptionFields (Group1.Choice1 [male] and Group1.Choice2 [female]).

Page 2 also has these same fields, with the same names.

In my version, Form.Fields shows me only 5 fields. 4 are the 4 RadioButtonOptions, and the 5th is the TextBoxField.

Note: As you stated, the Name field appears only once in Form.Fields, even though it has 2 instances (one in Page 1 and the other in Page 2). This is not the case with RadioButtonOptions. Even though they are named identically, each of the 4 instances appears in Form.Fields.

Earlier in a prior report to Aspose, I demonstrated that when a Form.Field has multiple instances (as in our example), the Field.Rect property is erroneous. The reason is because there is no single Field.Rect when there are multiple instances. Which Rect would you use? (This is merely a rhetorical question as the answer is obviously "neither").

What I showed was that Field.Rect is actually returning the smallest containing rectangle of both instances. For example, if Instance 1 had (100,100,200,120) and Instance 2 had (200,50,300,70), Field.Rect would return (100,50, 300,120). This result matches neither of the 2 instances. It is simply the smallest containing rectangle for both instances. You can try this and test for yourself.

So, with this error in mind, I set out to find a way around it. The work-around is to examine the Page.Annotations. Unlike the field, each annotation is its own instance. Not all annotations are fields, however, for every field, there are one or more annotations.

What I did was process each Annotation. For each Annotation of type field, I retrieved its Annotation.Rect. This Rect turned out to be correct since it is the Rect for the specific instance. Then, I searched the FieldCollection for Field.FullName == Annotation.FullName. On that basis, I was able to get the rest of the field information for each annotation - i.e., to match the annotation to its field.

This worked fine to a point. The point where it fails is with RadioButtonOptionFields. Form.Fields shows each of the 4 RadioButtonOptions in the example PDF. However, since the work-around requires processing each annotation for each page, there needs to be a way to get from the radio option's annotation back to its respective RadioButtonOption field.

Look at each Page.Annotation. You will see that each Annotation has Annotation.FullName. This property works fine for the TextBoxes. It does not work for RadioButtonOption. The RadioButtonOptionField has FullName = Group1 and OptionName = Choice1 (or Choice2, as applicable). However, the Annotation only has FullName = Group1. Annotation does not reveal OptionName. Therefore, we are unable to trace the given Annotation to its specific RadioButtonOptionField. So, we were able to obtain the valid rectangle for the given annotation, but we do not know how to tell which field renders in that rectangle. Annotation.Fullname = Group1. There are no other meaningful properties in the Annotation which I could find. How do we tell which RadioButtonOptionField belongs to the given Annotation?

It appears to me that the concept of a "Field" is not well-considered in that it was not designed to take into account that multiple instances of the Field exist in the form. Therefore, properties like Rect, PageIndex are meaningless at this level. How do you give a PageIndex to a field which has instances on both Page 1 and Page 2? (This is also a rhetorical question to emphasize the design flaw). The assignment of either page to the field is arbitrary and inaccurate.

Has the naming been fixed on your end (making my version obsolete)? Or are you seeing the same results/issues as me?

Basically, if I am looking at an Annotation, how do I find out which of the 4 RadioButtonOptions it represents?

Thanks.

Hi Jeff,


Thanks for your inquiry. Your form field has duplicate copy of the form fields, we have logged an investigation ticket PDFNEWNET-40687 in our issue tracking system for your requirements. We are coordinating with the team and will share our findings with you accordingly.

We are sorry for the inconvenience.

Best Regards,