Great news for .NET developers! We have released GroupDocs.Watermark for .NET 24.7 (DLLs-only) and it equips developers with multiple feature enhancements to upgrade their C# and VB.NET solutions across Windows, Linux, and macOS platforms.
Simplified Integration
The newest .NET document parsing and indexing API release includes the Add
method, which returns results with added watermarks and ensures simplified watermark integration. Check out the following code example to learn how to use this feature in your cross-platform C# apps.
using (Watermarker watermarker = new Watermarker("test.pdf", new PdfLoadOptions()))
{
// Create a text watermark with a specified text and font
var watermark = new TextWatermark("watermark", new Font("Arial", 48));
watermark.Opacity = 0.3;
watermark.RotateAngle = -45;
var result = watermarker.Add(watermark);
foreach(var item in result.Succeeded)
{
Console.WriteLine("WatermarkId: {0}", item.WatermarkId);
Console.WriteLine("WatermarkType: {0}", item.WatermarkType);
Console.WriteLine("PageNumber: {0}", item.PageNumber);
Console.WriteLine("WatermarkPosition: {0}", item.WatermarkPosition);
}
// Save the watermarked document and capture the watermarking result
WatermarkResult watermarkResult = watermarker.Save("result.pdf");
}
Source*
Accurate Tiled Watermark Control
Experience greater control over tiled watermarks and utilize the ability to rotate them relative to the center of the document. This feature facilitates developers with perfect alignment. The following sample code explains how to use this functionality with GroupDocs.Watermark for .NET 24.7.
using (Watermarker watermarker = new Watermarker("test.pdf", new PdfLoadOptions()))
{
// 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.Points,
Value = 100
},
WatermarkSpacing = new MeasureValue()
{
MeasureType = TileMeasureType.Points,
Value = 70
},
};
watermark.RotateAroundCenter = true;
watermark.Opacity = 0.3;
watermark.RotateAngle = -45;
// Add the text watermark with additional options
PdfArtifactWatermarkOptions textWatermarkOptions = new PdfArtifactWatermarkOptions();
watermarker.Add(watermark, textWatermarkOptions);
// Save the watermarked document and capture the watermarking result
WatermarkResult watermarkResult = watermarker.Save("result.pdf");
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Watermark for .NET 24.7 Release Notes.