Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To extract all images or images having specific type from the document, follow these steps:
C#
Document wordDocument = new Document("Extract Images from Word Document.doc");
NodeCollection pictures = wordDocument.GetChildNodes(NodeType.Shape, true);
int imageindex = 0;
foreach (Shape shape in pictures)
{
if (shape.HasImage)
{
string imageFileName = "data/Aspose_" + (imageindex++).ToString() + "_" + shape.Name;
shape.ImageData.Save(imageFileName);
}
}
Below is the code for extracting images from word document:
C#
XWPFDocument doc = new XWPFDocument(new FileStream("data/Extract Images from Word Document.doc",FileMode.Open));
IList<XWPFPictureData> pics = doc.AllPictures;
foreach (XWPFPictureData pic in pics)
{
FileStream outputStream = new FileStream("data/NPOI_" + pic.FileName,FileMode.OpenOrCreate);
byte[] picData= pic.Data;
outputStream.Write(picData, 0, picData.Length);
outputStream.Close();
}
Download Extract Images from Document from any of the below mentioned social coding sites:
Download Extract Images from Document from any of the below mentioned social coding sites:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.