We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to delete all the images in document whose size is less that 100x100?

Hi to all,
I want to delete certain images (floating or embedded pictures, not shapes,artword,equation) from document whose size is less than 100x100 or 400x100, how to do it based on Aspose.words.dll version 14 and VB.net 2008?

Thanks in advance for any help.

Ducaisoft

I have worked it out like this:

        Dim Shapes As Aspose.Words.NodeCollection = Doc.GetChildNodes(Aspose.Words.NodeType.DrawingML, True)
        For Each Shape In Shapes
            If Shape.ShapeType = Aspose.Words.Drawing.ShapeType.Image Then
                Dim W As Integer = Shape.Width
                Dim H As Integer = Shape.Height
                If W * H > 0 And (W < 110 And H < 85 Or W < 240 And H < 40 Or W < 100 And H < 90 Or W < 230 And H < 30 Or W < 90 And H < 70) Then
                    Shape.Remove()
                End If
            End If
        Next

@ducaisoft

Thanks for your inquiry. It is nice to hear from you that you have found the solution of your problem. You can use Shape.Width and Shape.Height properties to get the width and height of shape. You can use these properties to achieve your requirement.