Enhance your tools & applications with document editing features using REST API and Node.js Cloud SDK.
Start Free TrialGroupDocs.Editor Cloud SDK for Node.js supports editing a wide range of popular document formats in any type of Node.js application by integrating GroupDocs.Editor Cloud SDK for Node.js with GroupDocs.Editor Cloud REST API. You just need to upload supported document formats ((Microsoft Word, Excel spreadsheets, PowerPoint, TXT, HTML, XML) in any WYSIWYG HTML editor and convert it back to its original format keeping the same appearance after the document is edited.
GroupDocs.Editor Cloud SDK for Node.js is built as a layer on top of GroupDocs.Editor Cloud REST API that saves valuable development time by managing low-level requests and handling responses. The developers can focus on writing up the specific code only as needed in the project.
Check out GroupDocs.Editor Cloud SDK for Node.js at GitHub if you are looking for the source code to annotate file in the Cloud.
You can try GroupDocs.Editor Low-Code Node.js APIs without any limitations.
GroupDocs.Editor Cloud is also available as Docker image which can be used to self-host the service. Or you may build your own services using GroupDocs.Editor High-code APIs which currently drive our REST APIs.
//Get your App SID, App Key and Storage Name at https://dashboard.groupdocs.cloud (free registration is required).
global.editApi = editor_cloud.EditApi.fromKeys(appSid, appKey);
global.fileApi = editor_cloud.FileApi.fromKeys(appSid, appKey);
// The document already uploaded into the storage.
// Load it into editable state
let fileInfo = new editor_cloud.FileInfo();
fileInfo.filePath = "WordProcessing/password-protected.docx";
fileInfo.password = "password";
let loadOptions = new editor_cloud.WordProcessingLoadOptions();
loadOptions.fileInfo = fileInfo;
loadOptions.outputPath = "output";
let loadResult = await editApi.load(new editor_cloud.LoadRequest(loadOptions));
// Download html document
let buf = await fileApi.downloadFile(new editor_cloud.DownloadFileRequest(loadResult.htmlPath));
let htmlString = buf.toString("utf-8");
// Edit something...
htmlString = htmlString.replace("Sample test text", "Hello world");
// Upload html back to storage
await fileApi.uploadFile(new editor_cloud.UploadFileRequest(loadResult.htmlPath, new Buffer(htmlString, "utf-8")));
// Save html back to docx
let saveOptions = new editor_cloud.WordProcessingSaveOptions();
saveOptions.fileInfo = fileInfo;
saveOptions.outputPath = "output/edited.docx";
saveOptions.htmlPath = loadResult.htmlPath;
saveOptions.resourcesPath = loadResult.resourcesPath;
let saveResult = await editApi.save(new editor_cloud.SaveRequest(saveOptions));
// Done.
console.log("Document edited: " + saveResult.path);