I have an application that adds a large number of automated highlights. I have been using the HighlightAnnotation to do that. However, this type of annotation is not selectable and copyable once the resulting pdf is opened.
I tried using the SquareAnnotation instead, and it is selectable and copyable as desired. However, the only setting I can find to get a highlight property is opacity, which is not the same thing as highlight. It gives a washed out effect rather than a highlight effect.
I attached an example PDF showing the different types, including a pasted screenshot of the setting I manually changed on the SquareAnnotation in my PDF editor to show the desired settings.HighlightTypeExample.pdf (26.6 KB)
Is there a property on the SquareAnnotation that allows setting of the highlight mechanic rather than opacity?
Here is the code I used to generate the markups:
private void addHighlightMarkup(Page page, Rectangle coordinates, Document document)
{
HighlightAnnotation highlightAnnotation = new HighlightAnnotation(page, coordinates)
{
Title = “Highlight annotation here:” + coordinates.ToString(),
Color = Aspose.Pdf.Color.Yellow
};
document.Pages[1].Annotations.Add(highlightAnnotation);
}
private void addSquareAnnotation(Page page, Rectangle coordinates, Document document,double op)
{
var squareAnnotation = new SquareAnnotation(page, coordinates)
{
Title = "Square annotation here:" + coordinates.ToString(),
InteriorColor = Aspose.Pdf.Color.Yellow,
Opacity = op
};
document.Pages[1].Annotations.Add(squareAnnotation);
}