Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the previous section, we described three kinds of watermark that can be added to an Excel document using GroupDocs.Watermark API. Here we will focus on how to work with shapes.

Working with Shapes

Extracting Information about all Shapes in an Excel Document

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.

HTML
 <script src="https://gist.github.com/GroupDocsGists/74ed9bcf76d5386bb86f30d404903391.js"></script>

Removing a Particular Shape

You can also remove a particular shape from the worksheet as shown in the below code sample.

HTML
 <script src="https://gist.github.com/GroupDocsGists/ca259416dc93dff27cc556d0f8e3dbb2.js"></script>

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 as shown in the below code sample.

HTML
 <script src="https://gist.github.com/GroupDocsGists/75edaf99350d5a96f53828b710b388c2.js"></script>

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.

...

HTML
<script src="https://gist.github.com/GroupDocsGists/de110831d1ac7c110fcca9e4220edd20.js"></script>

Removing/Replacing Hyperlink Associated with a Particular Shape

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

...

Note

This feature is also supported for charts.

Replacing Text for Particular Shapes

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

...

HTML
<script src="https://gist.github.com/GroupDocsGists/9d6a8671359205929a14408857226742.js"></script>

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. This feature is supported since version 17.12. 

HTML
<script src="https://gist.github.com/GroupDocsGists/091ac7f7da56d755193f9f1b6d678c46.js"></script>

Setting Background Image for Particular Shapes

Since version 17.12, 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.

HTML
<script src="https://gist.github.com/GroupDocsGists/a9a91a4632b7dfa2046aa1cbd98ca14d.js"></script>

Updating Shape Properties

Since version 17.12, 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.

...