GroupDocs.Watermark for .NET 24.4 Release Notes
This page contains release notes for GroupDocs.watermark for .NET 24.4
The release of GroupDocs.Watermark version 24.4 introduces new feature which allows to use custom fonts. Also it includes several bug fixies.
Full list of changes in this release
Key | Category | Summary |
---|---|---|
WATERMARKNET-1656 | ★ Feature | Ability to use custom fonts for text watermarks |
WATERMARKNET-1598 | Enhancement | Extending the functionality of tiled watermarks for Word documents |
WATERMARKNET-1653 | 🔧 Fix | Background color is presenting when using PdfXObjectWatermarkOptions |
Major Features
Ability to use custom fonts for text watermarks
🌐 Our latest update introduces the ability to use custom fonts for text watermarks. It allows user to configure the folder where these custom fonts are located.
var fontsFolder = @"c:\CustomFonts\";
using (Watermarker watermarker = new Watermarker(documentPath))
{
// Initialize the font to be used for watermark
Font font = new Font("CustomFontName", fontsFolder, 36);
// Create the watermark object
TextWatermark watermark = new TextWatermark("Test watermark", font);
// Set watermark properties
watermark.ForegroundColor = Color.Blue;
watermark.Opacity = 0.5;
watermark.X = 10;
watermark.Y = 10;
// Add watermark
watermarker.Add(watermark);
watermarker.Save(outputFileName);
}
Extending the functionality of tiled watermarks for Word documents
using (Watermarker watermarker = new Watermarker("test.docx", 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.docx");
}