facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.21k stars 1.62k forks source link

Feature: Is there a plugin that implements pagination similar to Google Docs? #6524

Open pangguoqing opened 1 month ago

pangguoqing commented 1 month ago

Description

Is there a plugin that implements pagination similar to Google Docs?

image

I want to implement automatic pagination similar to Word and export the document as a Word file.

Impact

Does anyone have an implementation idea or an existing demo? I can try to implement it myself?

ivailop7 commented 1 month ago

There isn't one, but in the playground, there is 'page break' widget that makes it print per page. If you customize that plugin CSS to look like two split pages and somehow anchor it to a certain height to refer to A4 size (that's the hard part), might get you closer to what you are after

ivailop7 commented 1 month ago

Alternatively easier solution would be an editor per page and just concat those editors' contents

pangguoqing commented 1 month ago

Thank you very much for your reply. I am familiar with 'page break.' However, I am looking for more advanced features, such as the ability to set page size, headers, and footers. When a document spans multiple pages, I would like the overflow content to automatically move to the next page when the user inputs content at the beginning.

ivailop7 commented 4 weeks ago

Yeah, nothing out of the box for this.