IronPDF How-Tos Custom Watermarks How to Add Watermarks to PDFs in C# Using IronPDF Chaknith Bin Updated:June 22, 2025 A custom watermark is a personalized background image or text overlay added to a PDF page. It serves various purposes, including branding with logos or names, enhancing security with labels like 'Confidential,' ensuring copyright protection, and indicating document status. Custom watermarks can include text, images, or both, be applied selectively or universally, and their opacity can be adjusted for versatility in personalizing, securing, and contextualizing PDFs. IronPDF offers a one-liner to add watermarks to PDF format documents. The watermark feature accepts an HTML string to generate the watermark, which is capable of using all HTML features as well as CSS styling. Get started with IronPDF Start using IronPDF in your project today with a free trial. First Step: Start for Free Steps to Apply Custom Watermarks in C# Download the IronPDF Library for C# Render a new or import an existing PDF document. Configure the HTML string to be used as a watermark. Use the ApplyWatermark method to implement a watermark. Customize watermark rotation, opacity, and location as needed. Apply Watermark Example Utilize the ApplyWatermark method to apply a watermark to a newly rendered PDF or an existing one. This method accepts an HTML string as the watermark, allowing it to have all the features that HTML offers, including CSS styling. Let's use both an image and text as our watermark in the example below. Please note that the watermark will be applied to all the pages; it's not possible to apply the watermark to specific pages. Code :path=/static-assets/pdf/content-code-examples/how-to/custom-watermark-apply-watermark.cs using IronPdf; string watermarkHtml = @" <img src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>"; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>"); // Apply watermark pdf.ApplyWatermark(watermarkHtml); pdf.SaveAs("watermark.pdf"); Imports IronPdf Private watermarkHtml As String = " <img src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>" Private renderer As New ChromePdfRenderer() Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>") ' Apply watermark pdf.ApplyWatermark(watermarkHtml) pdf.SaveAs("watermark.pdf") $vbLabelText $csharpLabel Output PDF This is a very easy way to add image watermark text from a variety of image formats, such as PNG, and text watermark with a custom font. Watermark Opacity and Rotation Add a watermark with the default opacity of 50%. This level can be further configured according to the user's requirements. The ApplyWatermark method supports an overload that also accepts rotation as a parameter. By specifying 'rotation:' and 'opacity:', we can adjust these two parameters. Code :path=/static-assets/pdf/content-code-examples/how-to/custom-watermark-apply-rotation-opacity.cs using IronPdf; using IronPdf.Editing; string watermarkHtml = @" <img style='width: 200px;' src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>"; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>"); // Apply watermark with 45 degrees rotation and 70% opacity pdf.ApplyWatermark(watermarkHtml, rotation: 45, opacity: 70); pdf.SaveAs("watermarkOpacity&Rotation.pdf"); Imports IronPdf Imports IronPdf.Editing Private watermarkHtml As String = " <img style='width: 200px;' src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>" Private renderer As New ChromePdfRenderer() Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>") ' Apply watermark with 45 degrees rotation and 70% opacity pdf.ApplyWatermark(watermarkHtml, rotation:= 45, opacity:= 70) pdf.SaveAs("watermarkOpacity&Rotation.pdf") $vbLabelText $csharpLabel Output PDF Watermark Location on PDF file To specify the watermark location, use a 3x3 grid divided into 3 columns horizontally and 3 rows vertically. The horizontal options are left, center, and right, while the vertical options are top, middle, and bottom. With this configuration, we can set 9 different locations on each page of the document. Please refer to the image below for a visual representation of this concept. Add watermark to a specific location using the VerticalAlignment and HorizontalAlignment enums in the IronPdf.Editing namespace. Code :path=/static-assets/pdf/content-code-examples/how-to/custom-watermark-apply-watermark-top-right.cs using IronPdf; using IronPdf.Editing; string watermarkHtml = @" <img style='width: 200px;' src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>"; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>"); // Apply watermark on the top-right of the document pdf.ApplyWatermark(watermarkHtml, 50, VerticalAlignment.Top, HorizontalAlignment.Right); pdf.SaveAs("watermarkLocation.pdf"); Imports IronPdf Imports IronPdf.Editing Private watermarkHtml As String = " <img style='width: 200px;' src='https://ironsoftware.com/img/products/ironpdf-logo-text-dotnet.svg'> <h1>Iron Software</h1>" Private renderer As New ChromePdfRenderer() Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Watermark</h1>") ' Apply watermark on the top-right of the document pdf.ApplyWatermark(watermarkHtml, 50, VerticalAlignment.Top, HorizontalAlignment.Right) pdf.SaveAs("watermarkLocation.pdf") $vbLabelText $csharpLabel Output PDF Ready to see what else you can do? Check out our tutorial page here: Edit PDFs Frequently Asked Questions What is a custom watermark in a PDF? A custom watermark is a personalized background image or text overlay added to a PDF page. It serves purposes like branding, security, copyright protection, and indicating document status. How can I add a watermark to a PDF using C#? You can use IronPDF's ApplyWatermark method to add a watermark to a PDF. This method accepts an HTML string as the watermark, allowing you to leverage HTML features and CSS styling. Can I apply a watermark to only certain pages in a PDF? Currently, IronPDF applies the watermark to all pages of the PDF. It does not support applying watermarks to specific pages. How can I customize a watermark's opacity and rotation in a PDF? IronPDF allows you to customize a watermark's opacity and rotation by using an overload of the ApplyWatermark method that accepts parameters for these properties. What steps are involved in applying custom watermarks in C#? To apply custom watermarks, download IronPDF, render or import a PDF, configure an HTML string for the watermark, use the ApplyWatermark method, and adjust the watermark's rotation, opacity, and location as needed. How do I specify where a watermark appears on a PDF page? You can specify the watermark's location using a 3x3 grid system with horizontal options (left, center, right) and vertical options (top, middle, bottom) by utilizing the VerticalAlignment and HorizontalAlignment enums from the IronPdf.Editing namespace. What image formats can I use for watermarks? IronPDF supports various image formats for creating image watermarks, such as PNG. Can I style a watermark using CSS in HTML strings? Yes, IronPDF supports CSS styling in the HTML strings used to create watermarks, allowing for extensive customization. Is it possible to combine text and images in a single watermark? Yes, you can combine both text and images in a single watermark by properly configuring the HTML string used with the ApplyWatermark method. Where can I get the IronPDF library for C#? You can download the IronPDF library for C# from the NuGet package manager. Chaknith Bin Chat with engineering team now Software Engineer Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience. Ready to Get Started? Free NuGet Download Total downloads: 15,030,178 View Licenses