We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add a Watermark below the graphics and text in the existing PDF?

Platform: WinForms |
Control: PDF
Tags: pdf, watermark

To add a Watermark below the graphics and text in the existing PDF, you need to create page template from the existing document and draw the template into the new document on the Watermark. You can refer to the following code example.


//Loads the pdf document
PdfLoadedDocument ldoc = new PdfLoadedDocument("Bullets and Lists.pdf");
//Creats new pdf document
PdfDocument doc = new PdfDocument();
//itereate through the pages of loaded document
foreach (PdfLoadedPage lpage in ldoc.Pages)
//Adds new Page
PdfPage page = doc.Pages.Add();
//Create template from the loaded page
PdfTemplate template = lpage.CreateTemplate();
//Method for drawing Watermark from newly created pdf document page
//Draws template of loaded page from pdf document page.
page.Graphics.DrawPdfTemplate(template, PointF.Empty);
//Save the document and dispose it
doc.Save("Loaded.pdf", Response, HttpReadType.Save);
private void DrawWatermark(PdfPage page)
// Sets font
PdfFont bigFont = new PdfStandardFont(PdfFontFamily.Helvetica, 80f);
string s = "WaterMark";
//Saves the graphics state
PdfGraphicsState state = page.Graphics.Save();
//Measures the size of the string
 SizeF textSize = bigFont.MeasureString(s);
//The Translate transform changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
//Applying rotation for watermark
//Sets transparency
//Draw string
page.Graphics.DrawString(s, bigFont, PdfPens.Gray, PdfBrushes.LightGray, new PointF(0, 0));
//Restores the graphics state

Sample Link:


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile