How to Identify Worksheet Shapes via DrawObjectEventHandler

Hello,

We need to identify each Shape object within a worksheet when it is converted to PDF via the DrawObjectEventHandler framework (which is now available for PDF output per this thread).

Unfortunately, the only details related to shapes provided by the DrawObject are the getType() and getImageBytes() APIs. There doesn’t seem to be a way to identify which shape is being processed by the DrawObject.

For example, the attached workbook “DrawObjectShapes.xlsx” has a worksheet with an assortment of 26 Shapes. Note that some of the shapes should not print (nor be included in the PDF) because their “print object” property is set to false or the shape is hidden (via VBA).

Given this worksheet, how would we be able to map the printable shapes from a DrawObjectEventHandler implementation to the corresponding Shape in the Worksheet’s ShapeCollection?

Ideally, we would like a new API such as “getShape()” that compliments the existing getCell() API.

In lieu of a new API, please advice if there is a workaround to identify the shapes via the DrawObjectEventHandler framework.

Thanks.

@oraspose

Thanks for considering Aspose APIs.

We have logged your requirement in our database for investigation and for implementation. We will look into it and let you know any workaround if possible and implement this feature if feasible. Once, we will have some news for you, we will share it with you asap.

This issue has been logged as

  • CELLSJAVA-42529 - How to Identify Worksheet Shapes via DrawObjectEventHandler

@oraspose,

Please try our latest version/fix: Aspose.Cells for Java v18.2.4.

We add a new API: getShape() in DrawObject class.

Let us know your feedback.

The new getShape() API works well and satisfies all of our requirements.
Thanks Amjad and the Cells team for the quick resolution!

@oraspose

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

The issues you have found earlier (filed as CELLSJAVA-42529) have been fixed in this Aspose.Cells for Java 18.3 update. Please also check the <a href="Installation|Documentation

The issues you have found earlier (filed as CELLSJAVA-42529) have been fixed in this Aspose.Cells for Java 18.3 update. Please also check the document for your reference: Installation|Documentation