Add Watermark to PDF C#

Watermarks are an essential tool for protecting the integrity and ownership of digital documents. In this tutorial, you will explore how to add both textual and visual watermarks to PDF documents. Whether you’re looking to brand your documents or add copyright information, this step-by-step guide will help you to add text or image watermark using C#.

Add Watermark to PDF Online for Free

You can use this free app to add a watermark in PDF to insert any image or text watermark in a PDF document. You do not need to install any plugin or application as it is accessible using any web browser. You can set different text or image appearance properties like transparency, rotation, color, font, etc.

Insert Text or Image Watermark in PDF – C# API Installation

For inserting a watermark in a PDF document, you need to configure Conholdate.Total for .NET library. You may download it from the Releases section or install it with the following NuGet installation command:

Install-Package Conholdate.Total 

Add Text Watermark to PDF in C#

You can add a text watermark to a PDF document in C# by following the steps below:

  • Load the input PDF document.
  • Instantiate a TextStamp object.
  • Set the position and other appearance properties for the text watermark.
  • Set a Stamp ID for the text watermark to facilitate identification later.
  • Add the text watermark to a specific page.
  • Save the output PDF file with the added text watermark using the Document.Save() method.

The following sample code demonstrates how to add a text watermark to PDF in C#:

Add Image Watermark to PDF in C#

  • Load the input PDF document.
  • Retrieve a specific page from the input PDF.
  • Generate an image stamp.
  • Centrally position the image watermark.
  • Assign a unique stamp ID.
  • Apply the image stamp to a particular page or add it to all pages.
  • Save the modified PDF with the image watermark using the Document.Save() method.

The code snippet below shows how to add an image watermark to PDF in C#:

Get a Free Evaluation License

You may get a free temporary license to evaluate the API to its full capacity without any evaluation limitations.

Conholdate.Total for .NET - Learning Resources

Please refer to the following resources to further explore the learning material and understand different features:

Summing Up

In this tutorial, we explored how to add both text and image watermarks to PDF documents using C#. By following the step-by-step instructions, you can enhance your PDF documents with personalized watermarks to protect your content or add branding. In case of any queries, please feel free to reach out to us at the free support forum.

See Also