This release of GroupDocs.Watermark for .NET 24.3 (MSI) brings exciting enhancements focused on expanding the capabilities of tiled watermarks for various MS Office document formats, including Excel spreadsheets, PowerPoint presentations, as well as Visio diagrams and image files.
Improved Tiled Watermark Control in Excel Spreadsheets
With the latest update to the .NET document watermarking API, we have fine-tuned the functionality of tiled watermarks within Excel spreadsheets. .NET developers can now leverage the TileOptions
property to define line and watermark spacing for tiled watermarks accurately. The following code sample shows how to use this feature in C#.
using (Watermarker watermarker = new Watermarker("test.xlsx", new SpreadsheetLoadOptions()))
{
// Create a text watermark with a specified text and font
var watermark = new TextWatermark("watermark", new Font("Arial", 48));
// Configure TileOptions
watermark.TileOptions = new TileOptions()
{
LineSpacing = new MeasureValue()
{
MeasureType = TileMeasureType.Percent,
Value = 12
},
WatermarkSpacing = new MeasureValue()
{
MeasureType = TileMeasureType.Percent,
Value = 10
},
};
watermark.Opacity = 0.3;
watermark.RotateAngle = -30;
// Add the text watermark with additional options
var watermarkOptions = new SpreadsheetWatermarkShapeOptions();
watermarkOptions.IsLocked = true;
watermarker.Add(watermark, watermarkOptions);
// Save the watermarked document and capture the watermarking result
WatermarkResult watermarkResult = watermarker.Save("result.xlsx");
}
Source*
GroupDocs.Watermark for .NET 24.3 offers better control over tiled watermarks in image formats by utilizing the TileOptions
property to customize the spacing and positioning of watermarks. This sample code demonstrates how to add tiled watermarks to an image.
using (Watermarker watermarker = new Watermarker("test.png", new ImageLoadOptions()))
{
// Create a text watermark with a specified text and font
var watermark = new TextWatermark("watermark", new Font("Arial", 48));
// Configure TileOptions
watermark.TileOptions = new TileOptions()
{
LineSpacing = new MeasureValue()
{
MeasureType = TileMeasureType.Percent,
Value = 12
},
WatermarkSpacing = new MeasureValue()
{
MeasureType = TileMeasureType.Percent,
Value = 10
},
};
watermark.Opacity = 0.3;
watermark.RotateAngle = -30;
watermarker.Add(watermark);
// Save the watermarked document and capture the watermarking result
WatermarkResult watermarkResult = watermarker.Save("result.png");
}
Source*
Optimized Tiled Watermark Control in Presentations and Visio Diagrams
Users can now insert tiled watermarks within presentation formats as well. This release equips developers with the tools to create visually impactful watermarks that blend into their presentations. Similarly, adding tiled watermarks to Visio diagrams is possible with the C# watermarking API. Confidently incorporate this feature into your applications and obtain reliable results.
Fixed Bugs
- Fixed an issue where the spreadsheet shape watermark size did not match the specified font size (WATERMARKNET-1609).
- Resolved a problem where Visio documents could not be read when passing
DiagramLoadOptions
starting from .NET Standard (WATERMARKNET-1605). - Addressed an issue causing tiled watermark line offsets for positive rotation angles (WATERMARKNET-1602).
- Fixed a bug where a PDF watermark used an artifact approach when passing
PdfXObjectWatermarkOptions
(WATERMARKNET-1575).
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Watermark for .NET 24.3 Release Notes.