Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save groupdocs-cloud-gists/a69993ef226ba5cec5331217b01f72d1 to your computer and use it in GitHub Desktop.
Save groupdocs-cloud-gists/a69993ef226ba5cec5331217b01f72d1 to your computer and use it in GitHub Desktop.
Word document parser
Learn how to extract images from Word document using Node.js API
// For more examples, please visit https://github.com/groupdocs-parser-cloud/groupdocs-parser-cloud-node
const { Configuration, ParserApi, TextOptions, TextRequest, FileInfo } = require("groupdocs-parser-cloud");
const config = new Configuration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
const parserApi = new ParserApi(config);
const fileInfo = new FileInfo();
// path of word document
fileInfo.filePath = "sample.docx";
const options = new TextOptions();
options.fileInfo = fileInfo;
const request = new TextRequest(options);
parserApi.text(request).then(response => {
console.log("Extracted text content:");
console.log(response.text);
}).catch(err => {
console.error("Error extracting text:", err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment