GroupDocs.Watermark for Python via .NET API

Update Watermarks in Excel Spreadsheets Using Python

Secure your Excel spreadsheets with our flexible watermark editing tools for Python.

Modify watermarks in Excel documents with Python

GroupDocs.Watermark for Python via .NET helps Python developers easily update watermarks in various Excel files. Here’s how you can use it in your project:

  1. First, open your Excel file by passing it to the Watermarker constructor. You can use a file path, byte stream, or file stream.
  2. Then, find the watermarks you want to change using SearchCriteria, which lets you search for watermark text or properties.
  3. Once found, you can change details like text, font, size, position, color, and more. This gives you full control over how the watermark looks.
  4. After making changes, save the document. You can write the result to a stream or a file path.
# Update watermark text in EXCEL
import groupdocs.watermark as gw
import groupdocs.watermark.search.searchcriteria as gwss

# Create a Watermarker using a EXCEL file
with gw.Watermarker("input.xslx") as watermarker:

    # Set up TextSearchCriteria to find watermark text
    search_criteria = gwss.TextSearchCriteria("test", False)

    possible_watermarks = watermarker.search(search_criteria)
        for watermark in possible_watermarks:
            try:
                # Modify watermark text
                watermark.text = "passed"
            except Exception as e:
                pass
    
    watermarker.save("output.xslx")
pip install groupdocs-watermark-net
click to copy
copied
More examples Documentation

Discover more ways to update watermarks

With our library, Python apps can add, find, edit, or delete watermarks in many file types.

Watermark Editing

Watermark Your Files with Ease

Use GroupDocs.Watermark for Python via .NET to add and manage watermarks in your documents. Search, update, or remove watermarks as needed using a simple API.

Customize Watermarks to Fit Your Needs

Adjust watermark settings like font, size, orientation, and color using our flexible API to get exactly the result you want.

Use Format-Specific Features

Depending on the file format, you can use native features like headers, footers, annotations, or backgrounds as watermark areas.

Edit Text Watermark in Excel

This code shows how to change watermark text in Excel spreadsheets.

Python

# Open XLSX file
import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
import groupdocs.watermark.search.searchcriteria as gwss
import groupdocs.watermark.options.spreadsheet as gwos

# Read spreadsheet data
with gw.Watermarker("source.xlsx") as watermarker:

    search_criteria = gwss.TextSearchCriteria("test", False)
    search_criteria.pages = [1,3]

    # Change watermark text
    watermarks = watermarker.search(search_criteria)
    for watermark in watermarks:
        try:
            watermark.formatted_text_fragments.clear()
            watermark.formatted_text_fragments.add(
               "passed", 
                gww.Font("Calibri", 19.0, gww.FontStyle.bold), 
                gww.Color.red, 
                gww.Color.aqua
            )
        except Exception as e:
            pass

    # Save the result
    watermarker.save("output.xlsx")

GroupDocs.Watermark for Python via .NET Library

Quickly Edit Excel Watermarks: GroupDocs.Watermark for Python via .NET gives Python developers all the tools needed to manage watermarks with minimal effort, improving your document workflow and safety.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Watermark for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Update Watermarks in Other Formats

Easily customize watermark settings across different file formats using GroupDocs.Watermark for Python via .NET.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English