Words detecting Shape visibility

Hi,

I have a sample document. In it there are 2 shapes (Rectangles).

I then hide one of the shapes in Word

When I use Aspose Words to save the document as HTML, It generates the correct view with the “Invisible Shape” not present.

How is this achieved? I cannot find any property in Aspose Words that indicates the shape is hidden yet Aspose Words definitely knows that the shape is not visible. How can I detect this object being hidden via code (for purposes other than saving as HTML)? Sample document attached:

Word - Invisible Shape.docx (15.6 KB)

Thanks

@GaryO The hidden shapes are marked with hidden attribute in docPr of the shape:

<wp:docPr id="2077660866" name="Invisible Shape" hidden="1"/>

Aspose.Words reads this attribute and store in internally. Unfortunately, currently there is no public API to access it.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26193

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you.

I notice that the attribute is accessible in Cells with the “IsHidden” property for oleObject, Shapes, Picture and TextBoxes. Also, Slides has a “Hidden” property for Shapes. I’m assuming these also match the XML attributes so it would be good for consistency if it can be supported in Word as well.

@GaryO Internally the property is available as ShapeBase.Hidden. We will consider making it public in one of future versions of Aspose.Words.

1 Like