Latest release (March 2025)

We’re excited to announce a new release of our Python package! This update introduces a brand-new package with Linux support, along with generated API references to enhance IntelliSense for a smoother development experience. Additionally, we’ve included various fixes and improvements to ensure better stability and performance. Upgrade now and enjoy the enhanced functionality!

Full list of changes in this release

KeyCategorySummary
WATERMARKPYTHON-5★ FeatureLinux Support
WATERMARKPYTHON-7EnhancementEnhanced Development Experience with Autocomplete Support
WATERMARKPYTHON-14EnhancementCreated api reference documentation
WATERMARKPYTHON-8★ FeatureSupporting additional tile types
WATERMARKPYTHON-12★ FeatureAbility to specify file type when opening document
WATERMARKPYTHON-9EnhancementImproved tile watermarks calculation for large files
WATERMARKPYTHON-10EnhancementDecreasing python package size
WATERMARKPYTHON-11🔧 FixTiling watermarking

Linux Support

🌐 We’re thrilled to introduce Linux support in our latest release! Now, our package seamlessly runs on Linux-based environments, providing greater flexibility and broader compatibility for developers. The package is available for installation on PyPI https://pypi.org/project/groupdocs-watermark-net/#files or directly download from https://releases.groupdocs.com/watermark/python-net/

Enhanced Development Experience with Autocomplete Support

🌐 This release includes PYI definitions, enabling autocomplete functionality in your text editor or IDE. This feature simplifies the development process and API exploration.

Created api reference documentation

🌐 We’re excited to introduce the API Reference Documentation for our Python package! This new web resource provides a comprehensive overview of our package’s API, including detailed descriptions of classes, methods, and properties. It serves as a valuable guide for developers, making integration and usage easier than ever. Explore the documentation here API Reference Documentation

Supporting additional tile types

🌐 Our latest release introduces support for additional tile types in document watermarking! Now, you have more flexibility in how watermarks are applied, thanks to the enhanced TileType enumeration, which defines various tiling options. This improvement allows for greater customization and control over watermark placement across documents.

    USER_EMAIL = 'useremail@mail.com'
    FILE_ID = '1234-4a04-935f-3c83c3079a47'
    DISCLAIMER = 'Confidential - Do not distribute - Subject to NDA'

    with gw.Watermarker("sample.docx") as watermarker:
        font = gww.Font('Arial', 10.0)
        watermark = gww.TextWatermark(f'{USER_EMAIL}\n{FILE_ID}\n{DISCLAIMER}', font)
        watermark.foreground_color = gww.Color.gray
        watermark.opacity = 0.4
        watermark.rotate_angle = -45.0
        watermark.text_alignment = gww.TextAlignment.CENTER

        line_spacing = gww.MeasureValue()
        line_spacing.measure_type = gww.TileMeasureType.PERCENT
        line_spacing.value = 12.0

        watermark_spacing = gww.MeasureValue()
        watermark_spacing.measure_type = gww.TileMeasureType.PERCENT
        watermark_spacing.value = 10.0

        tile_options = gww.TileOptions()
        tile_options.tile_type = gww.TileType.ONE_THIRD_OFFSET
        tile_options.line_spacing = line_spacing
        tile_options.watermark_spacing = watermark_spacing

        watermark.tile_options = tile_options

        watermarker.add(watermark)
        watermarker.save("result.docx")

Ability to specify file type when opening document

🌐 The new feature in LoadOptions allows users to define the document type in advance, streamlining the loading process. If the file type is known beforehand, specifying it eliminates the need for format detection, enabling faster and more efficient document opening. This enhancement significantly improves performance, especially for large files.

    document_path = "sample.xlsx"
    # specifying file type eliminates the need for format detection, enabling faster document opening
    load_options = gwo.LoadOptions()
    load_options.file_type = gwс.FileType.from_extension(os.path.splitext(document_path)[1])

    # Or set the FormatFamily property directly when using a stream, for example:
    #load_options.format_family = gwс.FormatFamily.SPREADSHEET

    with gw.Watermarker(document_path, load_options) as watermarker:
        font = gww.Font("Arial", 36.0)
        watermark = gww.TextWatermark("Test\nwatermark", font)
        watermark.foreground_color = gww.Color.red;
        watermark.horizontal_alignment = gwс.HorizontalAlignment.CENTER
        watermark.vertical_alignment = gwс.VerticalAlignment.CENTER
        watermark.text_alignment = gww.TextAlignment.CENTER;

        watermarker.add(watermark)
        watermarker.save("result.xlsx")