Document and pages
The editor can edit a single document, and the document can have one or more pages. Each page is composed of multiple shapes.
Document
The document is correspond to the Doc class.
Access the document
Create a document
Use editor.newDoc()
instead of instantiating the Doc
class directly.
Save document to JSON
Load document from JSON
Page
A document must have at least one page, and the editor performs all tasks on a single current page. The page is correspond to the Page class.
Access to current page
Change the current page
Listen to the changes of current page
You can listen to the changes of current page through the both React component and editor object.
Add a page
To add a page in the current document: