Related Article(s):
Last active
July 24, 2024 09:06
-
-
Save GroupDocsGists/31e844930548c82972f8d98cdff1de18 to your computer and use it in GitHub Desktop.
How To Add Tiling Watermark to a PDF in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var watermarker = new Watermarker(“source.pdf”)) | |
{ | |
// Create the image watermark object | |
var watermark = new ImageWatermark(“lock-key.png”); | |
// Configure tile options | |
watermark.TileOptions = new TileOptions() | |
{ | |
LineSpacing = new MeasureValue() | |
{ | |
MeasureType = TileMeasureType.Percent, | |
Value = 12 | |
}, | |
WatermarkSpacing = new MeasureValue() | |
{ | |
MeasureType = TileMeasureType.Percent, | |
Value = 10 | |
} | |
}; | |
// Set watermark properties | |
watermark.Opacity = 0.3; | |
watermark.RotateAngle = -30; | |
// Add watermark | |
watermarker.Add(watermark); | |
watermarker.Save(“destin.pdf”); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment