auto document = MakeObject<Document>(_dataDir + u"sample.pdf");
auto page = document->get_Pages()->idx_get(1);
auto rect = MakeObject<Rectangle>(200, 750, 400, 790);
auto textAnnotation =
MakeObject<Aspose::Pdf::Annotations::TextAnnotation>(page, rect);
textAnnotation->set_Title(u"Aspose User");
textAnnotation->set_Subject(u"Sample Subject");
textAnnotation->set_State(Aspose::Pdf::Annotations::AnnotationState::Accepted);
textAnnotation->set_Contents(u"Sample contents for the annotation");
textAnnotation->set_Open(true);
textAnnotation->set_Icon(Aspose::Pdf::Annotations::TextIcon::Circle);
auto border = MakeObject<Aspose::Pdf::Annotations::Border>(textAnnotation);
border->set_Width(5);
border->set_Dash(MakeObject<Aspose::Pdf::Annotations::Dash>(1, 1));
textAnnotation->set_Border(border);
textAnnotation->set_Rect(rect);
page->get_Annotations()->Add(textAnnotation);
document->Save(_dataDir + u"sample_textannot.pdf");