Text Annotation Save State Does Not Work As Expected

While following the code sample from your website to add a text annotation, I’ve noticed the
textAnnotation.State does not work as expected. When I set it to “Accepted” and save it to PDF file. When I’ve opened the file and check the text notation, it’s state just point to “None”.

Here is the code snippet:

// Open document
Document pdfDocument = new Document();
// Create annotation
TextAnnotation textAnnotation = new TextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(200, 700, 400, 750));
textAnnotation.Title = “Sample Annotation Title”;
textAnnotation.Subject = “Sample Subject”;
textAnnotation.State = AnnotationState.Accepted;
textAnnotation.Contents = “Sample contents for the annotation”;
textAnnotation.Open = true;
textAnnotation.Icon = TextIcon.Key;
Border border = new Border(textAnnotation);
border.Width = 5;
border.Dash = new Dash(1, 1);
textAnnotation.Border = border;
textAnnotation.Rect = new Aspose.Pdf.Rectangle(200, 700, 400, 750);
// Add annotation in the annotations collection of the page
pdfDocument.Pages[1].Annotations.Add(textAnnotation);
// Save output file
pdfDocument.Save(“output.pdf”);
pdfDocument.Dispose();

Hi Ben,

Thanks for your inquiry. I have tested your scenario using Aspose.Pdf for .NET 11.2.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-40174 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:Calibri;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Best Regards,