Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active July 24, 2024 09:06
Show Gist options
  • Save GroupDocsGists/31e844930548c82972f8d98cdff1de18 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/31e844930548c82972f8d98cdff1de18 to your computer and use it in GitHub Desktop.
How To Add Tiling Watermark to a PDF in C#
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