Skip to content

Consider to completely drop the pdf.js text layer and reimplement the text selection in canvas #5

@mrtcode

Description

@mrtcode

If the native browser text selection becomes too annoying, consider to implement a separate text selection logic which will calculate the selection and draw the highlights in canvas.

The potential downsides would be that there is no real text and copy to clipboard would be more problematic. Text selection on touch devices can be more complicated too, although PDFTRON solves this by adding a text selection mode.

The benefits of this would be a more convenient text selection which is not flickering (which is terrible on chrome), automatically detects word boundaries and allows to start selection by clicking anywhere near the word or between lines or paragraphs. Also we would have a better control on what is selected, changing the already existing highlight annotation selection range would become possible and we would be independent from how selection works on different browsers.

While other parts of pdf.js are really good, the text layer part needs a complete rewrite to provide as good text selection experience as native PDF viewers. The text layer should firstly recreate the whole PDF structure like pdftotext does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions