Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KMJ-007
Copy link

@KMJ-007 KMJ-007 commented Nov 4, 2023

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

Copy link

changeset-bot bot commented Nov 4, 2023

⚠️ No Changeset found

Latest commit: 14b24ca

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@KMJ-007
Copy link
Author

KMJ-007 commented Nov 4, 2023

@diegomura can you look into this ?

@ASutrick
Copy link

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);
Copy link
Owner

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?

Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants