Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Event listener for currentPageNumber fully rendered

431 views
Skip to first unread message

David Shorthouse

unread,
Aug 27, 2012, 5:09:06 AM8/27/12
to mozilla-d...@lists.mozilla.org
Folks,

Is there a property or method in your PDFView that would allow me to determine when the text layer content for the current page is fully rendered and appended to the DOM?

I tried to use PDFView.pages[window.currentPageNumber-1].renderingState === 3 but no such luck. I had assumed renderingState meant ALL the text has rendered and is currently in the DOM.

What I am attempting to do (as I see others here as well) is manipulate the text, but to do so, the text layer content must be fully present. I've made several attempts with some degree of success, but because I must be doing my injections as the text layer gets rendered (i.e. hasn't yet fully appended), the sizes and positions of the div elements get mangled.

Thanks for any insight.

Dave

Brendan Dahl

unread,
Aug 27, 2012, 11:49:44 AM8/27/12
to David Shorthouse, mozilla-d...@lists.mozilla.org
There isn't currently an event for when the text overlay is finished rendering. The rendering states you're looking at only apply to the canvas rendering. However, you could add an event at https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L1753 to be notified when the text layer is done though.

Brendan
> _______________________________________________
> dev-pdf-js mailing list
> dev-p...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-pdf-js

Sunil Agrawal

unread,
Aug 27, 2012, 12:18:11 PM8/27/12
to Brendan Dahl, mozilla-d...@lists.mozilla.org, David Shorthouse
Does manipulating the text overlay actually affect the displayed text?

Brendan Dahl

unread,
Aug 27, 2012, 12:19:22 PM8/27/12
to Sunil Agrawal, mozilla-d...@lists.mozilla.org, David Shorthouse

On Aug 27, 2012, at 9:18 AM, Sunil Agrawal wrote:

> Does manipulating the text overlay actually affect the displayed text?

No, the text overlay is invisible and is just used for text selection.

Sunil Agrawal

unread,
Aug 27, 2012, 1:33:15 PM8/27/12
to Brendan Dahl, mozilla-d...@lists.mozilla.org, David Shorthouse
Hi Dave,

I think you'll have to continue looking on how to effectively do text
manipulation as Brendan said below, manipulating text layer doesn't change
what's displayed.

I am trying to do something similar, so if you have any ideas, would love
to hear.

Thanks, Sunil
0 new messages