How to add the HTML text to Contents of annotations to open the popup with html text in aspose pdf document
Ref:
string HTMLText = HTMLToText(WebUtility.HtmlDecode(s.annoateComment));
var pageRectangle = document.Pages[s.pageNumber ?? 0];
//var rectRectangle = new Rectangle((double)xValue, (double)yValue, (double)(width - xValue), (double)(height - yValue));
var rectRectangle = GetRectangle(document, (float)xValue, (float)yValue, (float)(width), (float)(height), (float)CHeight, (float)CWidth, s.pageNumber ?? 0, pageRectangle.Rotate);
var rectAnnotate = new SquareAnnotation(pageRectangle, rectRectangle)
{
Title = UserName + “-” + “PD” + “:” + DateTime.Now.ToString(),
Color = Aspose.Pdf.Color.Red,
InteriorColor = Aspose.Pdf.Color.MistyRose,
Contents = HTMLText.ToString(),
Opacity = 0.5,
Popup = new PopupAnnotation(pageRectangle, rectRectangle)
};
Border border = new Border(rectAnnotate);
border.Width = Convert.ToInt32(s.strokeWidth??2); ;
rectAnnotate.Border = border;
rectAnnotate.Color = Aspose.Pdf.Color.Parse(s.strokeColor);
pageRectangle.Annotations.Add(rectAnnotate);
Note: unable to show the HTML text in popup of aspose pdf document