When i try to use function : setRect, it's not display annotation. So, when i use Qads with 2 point's it's not the same of selected quads. Selected Quads Array include multiple points of rectangles....
.....
var annotManager = window.docViewer.getAnnotationManager();
var inputAnnot = new Annotations.TextHighlightAnnotation()
var color = "#"+parseInt(hightlight.color).toString(16);
color = $scope._hexToRgbA(color);
var StrokColor = new Annotations.Color();
StrokColor.R = color[0];
StrokColor.G = color[1];
StrokColor.B = color[2];
StrokColor.A = color[3];
inputAnnot.StrokeColor = StrokColor;
inputAnnot.Id = hightlight.highlight_id;
inputAnnot.Fill = StrokColor;
inputAnnot.Author = readerControl.getAnnotationUser();
var start_location = JSON.parse( hightlight.start_location.replace("{",'[').replace("}",']'));
var end_location = JSON.parse( hightlight.end_location.replace("{",'[').replace("}",']'));
var rect = new Annotations.Rect(start_location[0], start_location[1], end_location[0], end_location[1]);
inputAnnot.setRect(rect);
inputAnnot.Quads = [
{ x1: start_location[0],
x2: end_location[0],
x3: end_location[0],
x4: start_location[0],
y1: start_location[1],
y2: start_location[1],
y3: end_location[1],
y4: end_location[1]
}
]
inputAnnot.setPageNumber(hightlight.page_number);
inputAnnot.setContents(hightlight.highlight_text);
var res = annotManager.addAnnotation(inputAnnot);
annotManager.drawAnnotations(hightlight.page_number);
Can you send some example for drawing highlight's with 2 coordinates ?
Waiting for response,
Thanks,
Alexey P.
Classoos,