Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Support Color, Transparency, and Layout for Watermark #529

Closed
hq-zhonger opened this issue Jan 13, 2025 · 2 comments
Closed

Comments

@hq-zhonger
Copy link

Description

Currently, the document.Document.AddWatermarkText() function lacks support for configuring:

  • Color (e.g., red, blue, etc.)
  • Transparency (Opacity) (e.g., 50% opacity)
  • Text Layout Options (e.g., rotation, position settings)

For example, a typical watermark should allow customization like:

  • Font: Arial Unicode MS
  • Text: "CONFIDENTIAL"
  • Size: 48
  • Color: Red
  • Opacity: 50%
  • Rotation: 45° diagonal

However, unioffice does not provide built-in APIs for these configurations.

Expected Behavior

Provide API support for:

wm := doc.AddWatermarkText("CONFIDENTIAL")
wm.SetColor(color.Red)      // Set text color
wm.SetOpacity(50)           // Set transparency (50%)
wm.SetRotation(45)          // Rotate text by 45 degrees
Copy link

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized,
other issues go into our backlog where they are assessed and fitted into the roadmap when suitable.
If you need to get this done, consider buying a license which also enables you to use it in your commercial products.
More information can be found on https://unidoc.io/

@anovik
Copy link

anovik commented Feb 3, 2025

@hq-zhonger We have just released UniOffice v.2.0.0 https://github.com/unidoc/unioffice/releases/tag/v2.0.0 and support for text watermark opacity, color, and layout (horizontal vs. diagonal) has been added. These options are similar to MS Word.

Please check the following example for reference:

https://github.com/unidoc/unioffice-examples/blob/master/document/watermark-text/main.go

@anovik anovik closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants