Hi, I am
testing the newest version of web viewer (html5), that is 1.7.1. I would like to perform some
advanced operations, whose solution I could not find in the documentation:
- I can create a text highlight annotation and access it programmatically from
outside the viewer, but I can’t seem to get the highlighted text of the
annotation. The javascript method annotation.getContents() only gets the text
entered in the popup annotations, I would like instead to get the text of the
document that has been highlighted (even a ‘onAnnotationCreated’ event could do,
if any), so as to extract the text and perform some logic with it outside the
viewer.
- Is the text retrieved from the annotation (from previous question) pure text
or is there also some formatting information associated? (for instance if you
select multiple paragraphs, pointed lists, etc.). It would be good if it was
HTML, but being the document rendered inside a canvas I don’t know whether that’s
possible.
- Is there the possibility for every annotation to display a coloured vertical bar
in correspondence to the lines of text that constitute the annotation (right beside the 'A4' layout of the document)?
- Can I customize the list of annotation types (buttons) available for the
user in the toolbar? I would like to have just Text Highlight and maybe Text Underline.
Thank you
Mirko
$('#toolModePicker').find('#annot-button-polyline').hide();
// use GetPoints so that the points have nice values of x1,y1,x2,y2,etc
var quads = myAnnot.Quads.map(function(quad) {
return quad.GetPoints();
});
for (var i = 0; i < quads.length; ++i) {
// find top and bottom y coordinates
}
// add vertical bar element