Reputation: 783
I have a PDF file opened in a web page using PDFJS. now, I want to add JS event handlers,e.g. click, mouse hover etc, to all the text elements in the PDF. Since PDFJS open pdf using html5, is it possible to identify all text elements and add events to them?
Upvotes: 0
Views: 1442
Reputation: 506
Built-in PDF.js viewer uses TextLayerBuilder for text search. That class adds to html page transparent layer with text elements. You can use it, for adding events for text. This page describes how to use TextLayerBuilder class.
Upvotes: 1