-
Notifications
You must be signed in to change notification settings - Fork 450
Closed
Description
Opening issue, based on discussion with @dwhly on IRC.
Unfortunately, it looks like PDF.js is using a lazy approach for rendering of the text into the DOM. That means we have the same problem as we have with scribd - see #744.
Basically, we can not anchor to text that is not yet present in the dom.
We have not recognized this until so far, because we were testing only with short PDF files, which were always rendered instantly.
But (unlike with scribd), we have a chance to fix this, since PDF.js is open source.
We could do this:
- Recognize that we are in PDF.js. (Is not, do everything as we have done until now.)
- In PDF.js, before doing anything on the DOM, run the full reattachment process on the stored text. (This needs API access from PDF.js.) (Naturally, this would kils the range selectors, but position selectors and of course fuzzy could still work.)
- As we scroll around, and PDF.js renders the text into the DOM, it should send us scroll events, and then we should do the actual attaching of annotations.
- We also need to change the heatmap, so that it shows the info, about the not-yet attached annotations, too. (Mostly on the up- and down- arrows, since everything in the viewport will be attached already.)
This requires adapting (a big part of) our anchoring process from the DOM to the in-ram stored text of PDF.js.
This will likely take at least a month or so.
Metadata
Metadata
Assignees
Labels
No labels