function getSelectedText(annotation, callback) {
docViewer.on('textSelected.highlight', function(e, quads, text) {
docViewer.off('textSelected.highlight');
docViewer.clearSelection();
callback(text);
});
var numQuads = annotation.Quads.length;
var firstQuad = annotation.Quads[0].getPoints();
var lastQuad = annotation.Quads[numQuads - 1].getPoints();
var topLeft = {
x: firstQuad.x1,
y: firstQuad.y1,
pageIndex: annotation.getPageNumber() - 1
};
var bottomRight = {
x: lastQuad.x3,
y: lastQuad.y3,
pageIndex: annotation.getPageNumber() - 1
};
var textSelectTool = new Tools.TextSelectTool(docViewer);
textSelectTool.select(topLeft, bottomRight);
}