-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a |textlayerrendered| event #5606
Conversation
event.initCustomEvent('textlayerrendered', true, true, { | ||
pageNumber: pageView.id | ||
}); | ||
self.container.dispatchEvent(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can move event dispatching to the text_layer_builder.js (and avoid callback stuff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to implementing this the way you describe (should be fewer lines of code).
The reason that I didn't do so, is that the pagerendered
event is placed in pdf_viewer.js and not in pdf_page_view.js. Hence I figured that for the sake of consistency, textlayerrendered
should be implemented similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, shall we move pagerendered event too? :)
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/d977fff080de8f6/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/d977fff080de8f6/output.txt Total script time: 0.86 mins Published
|
@@ -53,6 +54,17 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() { | |||
} | |||
|
|||
TextLayerBuilder.prototype = { | |||
_afterRender: function TextLayerBuilder_afterRender() { | |||
if (!this.renderingDone) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this. or make it 'finishRendering' and assign this.renderingDone = true;
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed; I went for the _finishRendering
option since that meant less code duplication.
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/808f43fd5c1bb21/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/808f43fd5c1bb21/output.txt Total script time: 0.99 mins Published
|
Add a |textlayerrendered| event
Thank you |
Add a |textlayerrendered| event
Tentative patch, implementing #5511 (comment).