Skip to end of metadata
Go to start of metadata

The code samples in this article use some of the methods defined in Working with Common Utilities.

In the previous section, we described three kinds of watermark that can be added to an Excel document using GroupDocs.Watermark API:

  • Shapes
  • Backgrounds
  • Headers&Footers

Here we will focus on how to work with shapes.

Working with Shapes

Extracting Information about all Shapes in an Excel Document

The findWatermarks method searches watermarks of all mentioned types, but in some cases, it's necessary to analyze only one class of Excel objects. Following code sample shows how to get information about all the shapes in an Excel document.

Removing a Particular Shape

You can also remove a particular shape from the worksheet using below code sample.

Adding Watermark to all Image Shapes in an Excel Worksheet

Using GroupDocs.Watermark, you can add watermark to the image shapes that belong to an Excel worksheet. Following code sample shows how to add watermark to all image shapes.

Removing Shapes with Particular Text Formatting

You can also find and remove the shapes with a particular text formatting from an Excel document as shown in the below code sample.

Removing/Replacing Hyperlink Associated with a Particular Shape

Using GroupDocs.Watermark, you can also remove/replace hyperlink associated with a particular shape or chart inside an Excel document. The following code sample shows how to achieve this functionality.

This feature is also supported for charts.

Replacing Text for Particular Shapes

Replacing Shape's Text

GroupDocs.Watermark also supports replacing text for particular shapes in an Excel Worksheet. Following code sample shows the usage of this feature. 

Replacing Shape's Text with Formatted Text

You can also replace the text of the shapes with formatted text as shown in the following code sample.

Replacing Shape Image

GroupDocs.Watermark also allows you to replace the image of the particular shapes in an Excel Worksheet as shown in the following code sample.

Setting Background Image for Particular Shapes

GroupDocs.Watermark enables you to set the background image for the particular shapes in an Excel Worksheet. Following code sample shows the usage of this feature.

Updating Shape Properties

GroupDocs.Watermark also provides the feature of modifying properties of particular shapes in an Excel Worksheet. Following code sample shows how to use this feature.

Labels
  • No labels