hypothesis / hypothesis/client

No warning shown if most/many (but not all) pages in a PDF contain no selectable text

Open
#2,852 1 comment 0 reactions 0 assignees View on GitHub
bug easy wins New Contributor Friendly
Dominant language
Mustache
Stars
730
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Try to annotate http://jonudell.info/test/pdf/Human%20Mosaic%2011th%20ed%20Chapter%2001.pdf (through Via or the extension). The text in this PDF appears to be unselectable, but the [warning](https://github.com/hypothesis/client/pull/2623) about this is not shown. This will be confusing for users who don't know that Hypothesis annotation only works with PDFs that contain extractable text.

The reason the banner is not shown for this PDF is that it does contain one page with selectable text: Page 16 (according to the PDF.js navigation bar) / 11 (page number in the document itself). The current rules for deciding to show the "unselectable text" banner only check if the PDF has at least one page with selectable text. It would be good to improve the logic to handle this case better. Some ideas:

- Check if the majority of the first N pages in a PDF have no selectable text (the "first N pages" part is to limit the CPU cost of this check). If a majority do not have selectable text, we could show a modified version of the banner.
- Indicate somehow on a per-page basis whether the page contains selectable text

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.