Level up document security and branding with the most recent update to GroupDocs.Watermark for .NET (version 24.4, DLLs only package). This release introduces the capability to utilize custom fonts for text watermarks and refines the functionality of tiled watermarks within MS Word files.
Custom Fonts for Text Watermarks
The latest C# watermarking API version lets you incorporate a secure layer of branding with custom fonts for text watermarks. You can customize the (text) watermarks by specifying the font location within your code to obtain a distinctive look for your documents, as demonstrated in the C# code sample shared below.
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);
}
Source*
Tiled Watermark Improvements
Experience refined control over the placement of the tiled watermarks within Word documents. With this version of GroupDocs.Watermark for .NET, you can define line spacing and watermark spacing using percentages and ensure a more consistent and appealing document layout. Please check out the C# code example given below to learn how to use this feature.
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");
}
Source*
Fixed Bugs
The newest release includes a fixed issue related to background color appearing when using PdfXObjectWatermarkOptions
.
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Watermark for .NET 24.4 Release Notes.