Browse our Products
If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.
This release of the API has fixed the issue where font style underline was not previously working in watermarks.
1. Load the image.
Use the Watermark class constructor to load the image you want to add the watermark to.
string imagePath = @"C:\Docs\UnderlineFontStyle.png";
Watermarker watermarker = new Watermark(imagePath);
2. Create a font.
Create a new Font object with the desired font name, size, and style. In this example, we are using a 19-point Arial font with bold, italic, and underline styles.
Font font = new Font("Arial", 19, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
3. Create a text watermark.
Create a new TextWatermark object with the desired text and font. In this example, we are creating a text watermark with the text “Test watermark” and the font we created in the previous step.
TextWatermark watermark = new TextWatermark("Test watermark", font);
4. Set the watermark properties.
Set the foreground color, background color, text alignment, and opacity of the watermark. In this example, we are setting the foreground color to blue, the background color to yellow, the text alignment to center, and the opacity to 1.0 (fully opaque).
watermark.ForegroundColor = Color.Blue;
watermark.BackgroundColor = Color.Yellow;
watermark.TextAlignment = TextAlignment.Center;
watermark.Opacity = 1.0;
5. Add the watermark to the image.
Add the watermark to the image using the Add() method of the Watermarker class.
watermarker.Add(watermark);
6. Save the watermarked image.
Save the watermarked image to disk using the Save() method of the Watermarker class.
string outputPath = @"C:\Docs\OutputImage.png";
watermarker.Save(outputPath);
string imagePath = @"C:\Docs\UnderlineFontStyle.png";
string outputPath = @"C:\Docs\OutputImage.png";
using (Watermarker watermarker = new Watermarker(imagePath))
{
Font font = new Font("Arial", 19, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
TextWatermark watermark = new TextWatermark("Test watermark", font);
watermark.ForegroundColor = Color.Blue;
watermark.BackgroundColor = Color.Yellow;
watermark.TextAlignment = TextAlignment.Center;
watermark.Opacity = 1.0;
watermarker.Add(watermark);
watermarker.Save(outputPath);
}
For a complete list of features, enhancements, and bug fixes in this release please visit, GroupDocs.Watermark for .NET 23.4.