IRONSOFTWAREHOME

How to Add Watermarks to PDFs in C# Using IronPDF

Curtis Chau
Curtis Chau
Updated: August 2, 2026

IronPDF adds text or image watermarks to any PDF with the ApplyWatermark method, which takes an HTML string so you control styling, opacity, rotation, and placement through CSS and a 3x3 alignment grid. The watermark sits behind the page content, keeping the document readable while it carries branding or a security mark.

Quickstart: Apply a Watermark in One Line

Render or open a PDF, then call ApplyWatermark with an HTML string. The four-argument overload takes the HTML, an opacity value, and a VerticalAlignment / HorizontalAlignment pair that places the mark on the page.

  1. 1Install IronPDF with NuGet Package Manager

    PM > Install-Package IronPdf

  2. 2Copy and run this code snippet.

    IronPdf.PdfDocument.FromFile("input.pdf")
        .ApplyWatermark("<h1 style='color:red;'>Confidential</h1>", 50, IronPdf.Editing.VerticalAlignment.Top, IronPdf.Editing.HorizontalAlignment.Center)
        .SaveAs("output.pdf");
    C#
  3. 3Deploy to test on your live environment

    Start using IronPDF in your project today with a free trial
    arrow pointer

How Do I Apply a Watermark to My PDF?

Call ApplyWatermark on a freshly rendered or imported PdfDocument. The method accepts an HTML string, so the watermark can carry images, text, custom fonts, colors, and CSS layout. The example below combines a logo image and a heading into one mark. Watermarks apply to every page in the document; per-page marks are not supported through this method.

If you need to build the source document first, see the guides on creating PDFs and HTML to PDF conversion.

What HTML Can I Put in a Watermark?

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");

The watermark string accepts any standard HTML and CSS, including remote images and web fonts and icons. Because the mark renders behind the page content, the original text stays legible while the watermark supplies branding or a status label.

What Does the Watermarked PDF Look Like?


How Can I Adjust Watermark Opacity and Rotation?

A watermark applies at 50% opacity by default. To change it, pass opacity: (0 to 100, where 0 is transparent and 100 is fully opaque) and rotation: (0 to 360 degrees) as named arguments. A 45-degree rotation produces the diagonal mark common on draft and confidential documents.

What Parameters Control Opacity and Rotation?

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");

The rotation argument turns the mark around its center, and opacity sets how strongly it shows through. Together they tune how prominent the watermark is against the page beneath it.

What Does Rotation and Opacity Produce?


My favorite library of this kind is IronPDF. It allows for fast and efficient manipulation of PDF files. It also has many valuable features, like exporting to PDF/A format and digitally signing PDF documents.

Milan Jovanovic

Microsoft MVP

View case study

IronOCR means we can save $40,000 annually from manual processing, while enhancing productivity and freeing up resources for high-impact tasks. I would highly recommend it.

Brent Matzelle

Chief Technology Officer, OPYN

View case study

The IronSuite play a crucial role in our operations. These are tools that increase efficiencies across the business including creating floor plans and improving inventory management.

David Jones

Lead Software Engineer, Agorus Build

View case study

How Do I Position My Watermark on the PDF?

IronPDF places watermarks on a 3x3 grid: three horizontal columns (left, center, right) and three vertical rows (top, middle, bottom), giving nine positions per page. Select a spot with the VerticalAlignment and HorizontalAlignment enums from the IronPdf.Editing namespace. The image below maps each enum pair to its position.

IronPDF watermark alignment grid showing 9 positioning options with vertical and horizontal alignment properties

These are the same enums used by the stamp text and image feature, so positioning behaves consistently across both.

Which Alignment Enums Position the Watermark?

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");

This call passes an opacity value followed by VerticalAlignment.Top and HorizontalAlignment.Right, anchoring the mark to the top-right corner. Swap the enum values to move the watermark to any of the nine grid positions.

What Does the Positioned Watermark Look Like?

Conclusion

You have applied text and image watermarks with ApplyWatermark, tuned their opacity and rotation, and anchored them with the VerticalAlignment / HorizontalAlignment grid. When a single mark is not enough, the same alignment enums drive the stamp text and image feature for per-region overlays and full-page layers.

Frequently Asked Questions

How do I add a watermark to a PDF using IronPDF?

To add a watermark to a PDF with IronPDF, call the `ApplyWatermark` method on a `PdfDocument`. This method accepts an HTML string, which can include text, images, custom fonts, and CSS layout. The watermark can be positioned using a 3x3 alignment grid.

Can I use HTML to style my watermark in IronPDF?

Yes, you can use HTML to style your watermark in IronPDF. The `ApplyWatermark` method accepts an HTML string, allowing you to include images, text, colors, and CSS styles in your watermark.

How can I adjust the opacity of a watermark in IronPDF?

In IronPDF, you can adjust the opacity of a watermark by passing an opacity value (from 0 to 100) to the `ApplyWatermark` method. The default opacity is set to 50%.

Is it possible to rotate a watermark with IronPDF?

Yes, you can rotate a watermark in IronPDF. Pass a rotation angle (from 0 to 360 degrees) as an argument to the `ApplyWatermark` method. This helps in creating diagonal marks commonly used for confidential or draft documents.

How do I position a watermark on a PDF page using IronPDF?

IronPDF allows you to position a watermark on a PDF page using vertical and horizontal alignment enums. These are part of a 3x3 grid system with options such as `VerticalAlignment.Top` and `HorizontalAlignment.Center` to anchor the watermark in a specific position.

What types of content can I add to a watermark in IronPDF?

In IronPDF, you can include a variety of content in a watermark, such as images, text, web fonts, icons, and any HTML/CSS styling. This flexibility allows you to create rich and customized watermarks.

What does the default watermark opacity look like in IronPDF?

The default watermark opacity in IronPDF is set to 50%, which provides a balance between visibility and transparency, allowing the underlying document text to remain legible.

Are there specific examples of applying watermarks in IronPDF?

Yes, the provided examples in IronPDF documentation demonstrate applying watermarks with various adjustments, such as changing opacity, rotation, and positioning using the `ApplyWatermark` method.

Can I apply different watermarks to each page in a PDF using IronPDF?

Currently, the `ApplyWatermark` method in IronPDF applies the same watermark to all pages in the document. For unique marks on each page, additional logic would be needed.

Does IronPDF support remote images in watermarks?

Yes, IronPDF supports remote images in watermarks. You can specify URLs in the HTML string used in the `ApplyWatermark` method to include images hosted online.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 20,809,720Version:2026.9just released

Get your FREE

30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
bullet_testTest in production
without watermarks
bullet_calendar30 days fully
functional product
bullet_support24/5 technical
support during trial
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required