Streamline document security and branding with the latest update to GroupDocs.Watermark for .NET (version 24.4, MSI installer). This release is loaded with the ability to leverage custom fonts for text watermarks and the enriched functionality of tiled watermarks in Word documents.
Customizable Text Watermarks
Introduce a layer of security and brand identity using custom fonts for text watermarks with this version of the C# watermarking API. To customize the text watermarks in your .NET applications, simply specify the font location within your code to achieve a unique visual style, as illustrated in the following code sample.
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*
Boost Tiled Watermarks
Developers can enjoy greater control over tiled watermark placement within Word documents. This release of GroupDocs.Watermark for .NET allows you to define line spacing and watermark spacing using percentages, ascertaining a more consistent and visually appealing 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.