Any help for how to separate TipTap content into pages? #4806
Unanswered
ancientstraits
asked this question in
Questions & Help
Replies: 1 comment 3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So for a project I have to do, the client has asked me to separate the content into pages, like in Google Docs. However, information on how to do this is few and far between. I found this project, but I don't know if it works, because it is 4 years old, and the code is extremely confusing. Then, I had an idea to make a version of the HorizontalRule that is actually a div that makes it look like there is a break in the page between the two pages. Then, I could add these
PageBreak
nodes at specific points in the editor to separate the content into pages. However, I have no idea how to do this. I want to make an extension command to do this, but I would have to know the size of everything, once it is rendered into HTML. It would be a bit easier if I could useeditor.getHTML()
, but that function does not work in custom commands, since you cannot doconst { editor } = useCurrentEditor()
in editor commands. So does anyone have any pointers on what I could do?I already checked this discussion, but it was not that useful. I really need to add pagination to the editor, since the client requested it. Also, I do not think
pagedjs
can paginate content. I really don't know, since its website is extremely vague, and its examples are just books.Beta Was this translation helpful? Give feedback.
All reactions