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

Auto paging now uses last element offset for specific page #3718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

primus11
Copy link

@primus11 primus11 commented Mar 29, 2024

Auto paging now remembers last element offset for all pages and uses correct one depending on page to prevent weird text offset. This happened because html2canvas doesn't send elements in order so it is possible that element from page 4 will arrive before element from page 1. Specifically in added test <em>basic></em> and <strong>tiptap</strong> will be processed as last elements for this pdf.

Note that this also means that it should be probably possible to create element which will not correctly increase offset (example: if above tiptap would need to be moved to next page it will cause that offset for pages 2-4 will be wrong).

Note also that based on how pages are retrieved it should be also possible that these elements might be positioned on wrong page (example: if we would have 100 pages that would increase offset by more than a page getPagesByPath would return +1 page for tiptap even if it should be on first page)

Auto paging now remembers last element offset for all pages and uses correct one depending on page to prevent weird text offset. This happened because html2canvas doesn't send elements in order so it is possible that element from page 4 will arrive before element from page 1. Specifically in added test `<em>basic></em>` and `<strong>tiptap</strong>` will be processed as last elements for this pdf.
Note that this also means that it should be probably possible to create element which will not correctly increase offset (example: if above tiptap would need to be moved to next page it will cause that offset for pages 2-4 will be wrong).
Note also that based on how pages are retrieved it should be also possible that these elements might be positioned on wrong page (example: if we would have 100 pages that would increase offset by more than a page getPagesByPath would return +1 page for tiptap even if it should be on first page)
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.

None yet

1 participant