mozilla/pdf.js — pull request #1918 by jviereck (2012-07-21 20:24:29+00:00)
Title: Improve text search and highlight selected match

These patches improve the text-extraction algorithm to

1. Get better space support in the extracted text
2. Extract text also inside of xForm elements

Also, it implements a hacky version to highlight the text, that got selected from the search result list + scroll it into place.

There are quite some bugs:

* The highlighting only shows up if the page to highlight the text on already started to render
* The highlighting doesn't show up 100% at the right place. That's /bc the mapping between search and textDiv doesn't fit 100%

There is no highlight "all search results" feature right now (even a long train ride ends somewhen...). Implementing this should be only a question of time.

I don't like the way the highlighting information is stored right now and the entire object relation for the highlighting.