如何在Aspose.Word生成的word文档中获取所有已卸载的图像。像这样的图像。 Unloaded Image
答案 0 :(得分:3)
我已经解决了我的问题。我在这里发布我的答案,也许这对其他人有帮助。
var doc = new Document();
var shapeCollection = doc.GetChildNodes(Word.NodeType.Shape, true);
// getting all images from Word document.
foreach (Shape shape in shapeCollection)
{
if (shape.ShapeType == ShapeType.Image)
{
//Unloaded image alwasy have 924 imagebytes
if (shape.ImageData.ImageBytes.Length == 924)
{
shape.Width = 72.0;
shape.Height = 72.0;
}
}
}