mozilla/pdf.js — pull request #1119 by devietti (2012-01-24 03:30:10+00:00)
Title: Extract text for highlight/underline annotations v2

Like my previous pr #1078, except now rendered characters and annotations are transformed into device space to perform hit-testing. This seems to be a much more robust way of doing the hit-testing.

I added some infrastructure for automated test cases, and they work more reliably than in #1078. I'm using Firefox 9.0.1 and Chrome 16.0.912.75 on Mac 10.7. There are 2 issues I'm aware of:

1. The issue840 eq test fails in Firefox, but works in Chrome
2. A highlight inside Figure 12 of the Tracemonkey paper causes "garbage" characters to be extracted. It's probably a font encoding issue. For what it's worth, Preview and Adobe Reader X on Mac OS X extract the exact same "garbage" via copy+paste.