簡體   English   中英

如何使用Aspose.Word獲取Word文檔中的所有卸載圖像

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

我如何在Aspose.Word生成的Word文檔中獲取所有卸載的圖像。 像這樣的圖像。 卸載的圖像

我已經解決了我的問題。 我在這里發布我的答案,也許對其他人有幫助。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM