Skip to content

on getPageText, DocumentViewer returns undefined if text has not yet been presented in the viewer #53

Open
@AbeHandler

Description

@AbeHandler

Go to this URL: https://www.documentcloud.org/documents/1314000-sbrown-2014-2017-executed-contract.html

In console, run:

DV.viewers[_.keys(DV.viewers)[0]].api.getPageText(2)

It returns undefined.

Now go to page 2. Click the text tab. The text loads. Then in the console, run this again:

DV.viewers[_.keys(DV.viewers)[0]].api.getPageText(2)

This time, it returns page 2 of the document text.

It would be great if the API would pull the requested text on call to getPageText -- even if the user has not clicked that text tab yet. I need this functionality in order to (cleanly) add span tags around each token in the document text. Trying to do this: datamade/parserator#16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions