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

Free Support Forum - aspose.com

FreeTextAnnotations are not consistent in the use of Intent property

When using the FreeTextAnnotation object, the Intent property is not always populated as defined in the documentation.


For example, in the attached file named “Text box and Callout.pdf,” if I look at the Intent property I see that the Annotation that is a callout (Annotations[2]) is labeled “FreeTextCallout.” However the first Annotation has an intent labeled as "Undefined."

In the second attached file “Text Comment.pdf,” the only annotation which is a Text Comment (sometimes called Typewritten text) is also undefined.

Sample Code:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(openFileDialog1.FileName);
Aspose.Pdf.Page pg = doc.Pages[1];
Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation ftAnnot= (Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation)pg.Annotations[1].Intent;
System.Diagnostics.Debug.Write(ft.Intent);

Hi,


Can you please share which version of API you are using because I am getting following error message when trying to execute the code with Aspose.Pdf for .NET 9.6.0. If possible, please share some sample project/application so that we can again try replicating the issue at our end. We are sorry for your inconvenience.


Error 1 ‘Aspose.Pdf.InteractiveFeatures.Annotations.Annotation’ does not contain a definition for ‘Intent’ and no extension method ‘Intent’ accepting a first argument of type ‘Aspose.Pdf.InteractiveFeatures.Annotations.Annotation’ could be found (are you missing a using directive or an assembly reference?)

Sorry–had a couple of typos in the sample code. Here’s a correct version:


Aspose.Pdf.Document doc = new Aspose.Pdf.Document(openFileDialog1.FileName);
Aspose.Pdf.Page pg = doc.Pages[1];
Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation ftAnnot = (Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation)pg.Annotations[1];

System.Diagnostics.Debug.Write(ftAnnot.Intent);

Hi,


Thanks for sharing the code snippet.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37524. We will
investigate this issue in details and will keep you updated on the status of a
correction. <o:p></o:p>

We apologize for your inconvenience.