-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
added currentPageCallBack for the process of the current page #2437
base: master
Are you sure you want to change the base?
Conversation
|
@diegomura can you look into this ? |
Would love to see this implemented |
@@ -45,7 +45,7 @@ const pdf = initialValue => { | |||
pageMode, | |||
}); | |||
|
|||
const layout = await layoutDocument(container.document, fontStore); | |||
const layout = await layoutDocument(container.document, fontStore, currentPageCallBack); |
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.
This seems very specific to this case. Seems likely we want to report more things to the outside. Maybe we can pass an event emitter to layout, and internally emit events?
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.
call back looks fairly simple and straightforward, but as you are saying to pass an event to layout, when i was doing the call back, i tried to add the calllback to all the 12 functions, but it was slowing the speed of pdf creation, so i just added them to few, worried about the performance overhead if we implement in all the steps,
emitting events also makes senes to me, both works!
in large pdf, want to show the progress of the currently processed pages, so user can also know where the process has reached, and don't close the window
let me know what i can do better, i just had this in my mind, so implemented it