If you have a requirement to extract embedded images from Word documents for archiving, automation, or image recognition? Then, our Node.js REST API offers a robust and cloud-based solution to extract images from .doc and .docx files without needing Microsoft Word installed.

The image extraction need may also occur if we need to:

  • Capture graphics, charts, and photos embedded in reports.
  • Automate extraction from scanned documents or templates.
  • Build image datasets from document repositories.
  • Preprocess content for OCR or AI tasks.

Let’s explore the following topics in more details:

Word Document Image Extraction API

The GroupDocs.Parser Cloud SDK for Node.js is a REST based solution offering the capabilities to parse MS Word documents for content manipulation. Not only Word document, but it also offers the support for content extraction from almost all the common business document formats including (PPTX, Excel, PDF, ZIP, etc.).

Prerequisites

npm install groupdocs-parser-cloud
  • For more information on client credentials, please visit this article.

How to Extract Images from Word using Node.js

Follow these steps to develop a simple and robust application to extract images from MS Word Document using Node.js API:

Step 1: Initialize Configuration.

const { ParserApi, Configuration, ImagesRequest, FileInfo, ImagesOptions } = require("groupdocs-parser-cloud");

const config = new Configuration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
const parserApi = new ParserApi(config);

Step 2: Setup File Info and Image Options. Initialize an object of the ImagesRequest class and pass the instance of the ImagesOptions class.

const fileInfo = new FileInfo();
// path to your PowerPoint file
fileInfo.filePath = "input.docx";

const options = new ImagesOptions();
options.fileInfo = fileInfo;

const request = new ImagesRequest(options);

Step 3: Extract Images from Word Document. Invoke the images method to extract images from word document online.

parserApi.images(request).then((response) => {
    console.log("The Word document Images extracted successfully.");
    console.log(response.images);
}).catch((err) => {
    console.error("Failed to extract images:", err);
});

You can see the output of the above code sample in the image below:

A preview of image extraction from Word document using Node.js API

Extract Images from Word via cURL

If you prefer command line approach for extracting Word document images using cURL commands, then GroupDocs.Parser Cloud supports these capabilities. Let’s further explore this feature to simplify the requirement on how to obtain images from Word document using cURL commands.

Step 1 – Generate Access Token:

curl -X POST "https://api.groupdocs.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded"

Step 2 – Extract Images from Word File:

curl -v -X POST "https://api.groupdocs.cloud/v1.0/parser/images" \
-H  "accept: application/json" \
-H  "authorization: Bearer {ACCESS_TOKEN}" \
-H  "Content-Type: application/json" \
-d "{  
        \"FileInfo\": {
            \"FilePath\": \"input.docx\",
            \"StorageName\": \"internal\"
            },
            \"OutputPath\": \"internal\",
            \"StartPageNumber\": 1,
            \"CountPagesToExtract\": 2
    }"
  • 🔐 Replace <ACCESS_TOKEN> with the one you generated.
  • In case you need to extract the images from the whole document, simply ignore the parameters StartPageNumber & CountPagesToExtract.

Try Free Word Image Extractor Online

If you prefer a UI-based approach for extracting the Word document images, then you may consider using our free online Word Document Image Extractor powered by GroupDocs.Parser Cloud.

Free Images Extractor

Conclusion

With GroupDocs.Parser Cloud SDK for Node.js, extracting images from Word files becomes quick and scalable. Whether you need to process contracts, reports, or scanned forms — this API gives you complete control over Word document image extraction.

📚 Additional Resources

Frequently Asked Questions – FAQs

Can I extract images from specific pages in a Word document?

  • Yes. You can define StartPageNumber and CountPagesToExtract parameters.

Are the images extracted in original format and resolution?

  • Yes. The API returns embedded images as they are in the document.

Do I need Microsoft Word installed?

  • No. This is a cloud-based solution and works independently of MS Office.

Is there a free trial?

  • Yes. You can get 150 free API calls per month with a trial account. For more information, please visit pricing guide.