如何使用 Aspose.Word 获取 word 文档中所有未加载的图像

How can I get all unloaded images in word document using Aspose.Word

如何获取Aspose.Word生成的word文档中所有未加载的图片。像这样的图像。 Unloaded Image

我的问题已经解决了。我在这里发布我的答案,也许对其他人有帮助。

    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;                            
                        }
                    }
                 }