Skip to content

Highlighting Text

respinos edited this page Sep 5, 2017 · 1 revision

Highlighting is a function of the EPUB engine. Currently it is exposed for the epub.js/v0.3 engine:

// a CFI range
var cfiRange = "epubcfi(/6/14[Acknowledgement]!/4/4,/1:637,/1:665)";

// add a highlight
reader.annotations.highlight(cfiRange);

// add a highlight with data
reader.annotations.highlight(cfiRange, {});

// add a highlight with a callback
reader.annotations.highlight(cfiRange, {}, cb);
Clone this wiki locally