I am using the "Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation" for the annotation.
The annotation-text is NOT getting wrap automatically based on the Rectangle size, instead, part of the text has got truncated.
Attached the screenshot for your analysis.
Please find below the code:
------------------------------------------------------------------------------------------------
FreeTextAnnotation stxt = new FreeTextAnnotation(doc.Pages[pageNumber], rect, defApp);
stxt.Name = JsonConvert.SerializeObject(tbdetails);
stxt.Title = "Text Annotation";
stxt.HorizontalAlignment = HorizontalAlignment.Left;
stxt.Contents = text;
var bdr = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(stxt);
bdr.Width = 1;
bdr.Effect = BorderEffect.Cloudy;
bdr.EffectIntensity = 1;
stxt.Characteristics.Border = System.Drawing.Color.Transparent;
if (tbdetails.TextBoxBackground.Equals("opaque", StringComparison.InvariantCultureIgnoreCase))
{
stxt.Characteristics.Background = System.Drawing.Color.White;
stxt.Color = Aspose.Pdf.Color.White;
}
else
{
stxt.Characteristics.Background = System.Drawing.Color.Transparent;
stxt.Color = Aspose.Pdf.Color.Transparent;
}
doc.Pages[pageNumber].Annotations.Add(stxt);
------------------------------------------------------------------------------------------------