GroupDocs.Editor for Node.js and Java supports editing WordProcessing formats such as DOC, DOCX, DOT, DOCM, DOTX, ODT, and RTF. It allows two processing modes:
float (default)
paged (also known as paginal)
In float mode, the document appears as a single page when loaded into the WYSIWYG editor. In paged mode, the document is displayed with its original page breaks, similar to Microsoft Word.
Loading WordProcessing documents
Start by loading the document into the Editor class. Here’s an example of loading a password-protected DOCX file:
constgroupdocs=require('groupdocs-editor');constEditor=groupdocs.Editor;constWordProcessingLoadOptions=groupdocs.options.WordProcessingLoadOptions;// Load options for a password-protected document
constloadOptions=newWordProcessingLoadOptions();loadOptions.password="some_password_to_open_document";// Load the document into the Editor
constinputPath="C://input_path/document.docx";consteditor=newEditor(inputPath,loadOptions);---##HowtoeditaWorddocument?GroupDocs.EditorforNode.jssupportseditingWordProcessingformatssuchasDOC,DOCX,DOT,DOCM,DOTX,ODT,andRTF.Itallowstwoprocessingmodes:-**float**(default)-**paged**(alsoknownas**paginal**)Infloatmode,thedocumentappearsasasinglepagewhenloadedintotheWYSIWYGeditor.Inpagedmode,thedocumentisdisplayedwithitsoriginalpagebreaks,similartoMicrosoftWord.###LoadingWordProcessingdocumentsStartbyloadingthedocumentintothe`Editor`class.Here’sanexampleofloadingapassword-protectedDOCXfile:```javascript
const groupdocs = require('groupdocs-editor');
const Editor = groupdocs.Editor;
const WordProcessingLoadOptions = groupdocs.options.WordProcessingLoadOptions;
// Load options for a password-protected document
const loadOptions = new WordProcessingLoadOptions();
loadOptions.password = "some_password_to_open_document";
// Load the document into the Editor
const inputPath = "C://input_path/document.docx";
const editor = new Editor(inputPath, loadOptions);
If the document is unprotected, the password will be ignored. If the document is protected but no password is provided, an error will be thrown during editing.
Editing WordProcessing documents
Once the document is loaded, you can edit it by creating WordProcessingEditOptions: