added currentPageCallBack for the process of the current page#2437
added currentPageCallBack for the process of the current page#2437KMJ-007 wants to merge 2 commits intodiegomura:masterfrom
Conversation
|
|
@diegomura can you look into this ? |
|
Would love to see this implemented |
| }); | ||
|
|
||
| const layout = await layoutDocument(container.document, fontStore); | ||
| const layout = await layoutDocument(container.document, fontStore, currentPageCallBack); |
There was a problem hiding this comment.
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.
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