@it-yeq
Thanks for your patience.
Please note that there is no single annotation in the API which can add a rectangle and arrow on the page. Instead, you need to draw a rectangle separately and then add a line annotation (with arrow head) to connect with added rectangle. For example, please check in the below code snippet and feel free to let us know in case you need further information:
Document mRes = new Document();
mRes.Pages.Add();
Page page = mRes.Pages[1];
page.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
// Draw canvas according to page height/widht where shapes will be added
var canvas = new Aspose.Pdf.Drawing.Graph((float)mRes.PageInfo.Width, (float)mRes.PageInfo.Height);
page.Paragraphs.Add(canvas);
Aspose.Pdf.Drawing.Rectangle myRec = new Aspose.Pdf.Drawing.Rectangle(0, 738, 180, 100);
var c = ColorTranslator.FromHtml("#0099ff");
myRec.GraphInfo.Color = Aspose.Pdf.Color.FromRgb(c);
myRec.Text = new TextFragment("Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum");
myRec.Text.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(c);
canvas.Shapes.Add(myRec);
// Start point where the above rectangle's right-bottom corner ends i.e. x = 180, y = 738
Point startH = new Point(myRec.Width, myRec.Bottom);
// End Point for how long and in which direction the line arrow should point to e.g. x = 180+300, y = 738 - 100
Point endH = new Point(myRec.Width + 300, myRec.Bottom - 100);
// DrawArrow
LineAnnotation line2 = new LineAnnotation(page, new Rectangle(180, 738, 480, 638), startH, endH)
{
Intent = LineIntent.LineDimension,
Color = Aspose.Pdf.Color.Black,
EndingStyle = LineEnding.OpenArrow,
StartingStyle = LineEnding.None
};
Border border2 = new Border(line2);
border2.Width = 2;
line2.Border = border2;
page.Annotations.Add(line2);
mRes.Save(dataDir + "RectangleAndArrow.pdf");