Adding a watermark to PDF files is one of the most effective ways to protect your documents from unauthorized use and establish brand identity. Using the .NET Cloud SDK, you can easily add text watermarks to PDF documents, apply stamps, and customize the appearance of your watermark — all programmatically through a simple .NET REST API.



Why Add Watermark to PDF Documents?

Watermarks serve several purposes for PDF documents, including:

  • Branding: Add company logos or names as visible marks on every page.
  • Copyright Protection: Prevent content misuse or plagiarism.
  • Confidentiality: Mark documents with tags like “Confidential” or “Draft.”
  • Professional Presentation: Customize with signatures, dates, or project names.

PDF Watermark REST API for .NET

The GroupDocs.Watermark Cloud SDK for .NET provides a REST API for adding, editing, and managing watermarks across PDF, Word, PPTX, Excel, and image files. The watermark ensures your files remain protected and visually consistent.

Key Features

  • Insert text or image watermarks into PDF files.
  • Apply watermarks to all pages or selected pages.
  • Adjust transparency, font, rotation, and alignment.
  • Remove or update existing watermarks in documents.

Installation

Install the SDK via NuGet:

Install-Package GroupDocs.Watermark-Cloud

Add Text Watermark to PDF in C#

Follow these steps to add a text watermark to a PDF document using C# .NET.

Step 1. – Initialize the API.

var configuration = new Configuration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
var watermarkApi = new WatermarkApi(configuration);

Step 2. – Specify the name of input PDF file.

var fileInfo = new FileInfo
{
    FilePath = "3D Periodic Table.pdf"
};

Step 3. – Define watermark’s text, font, and appearance.

TextWatermarkOptions = new TextWatermarkOptions
{
    Text = "Confidential",
    FontFamilyName = "Arial",
    FontSize = 20d,
}

Step 4. – Add the Text Watermark.

var request = new AddRequest(options);
var response = watermarkApi.Add(request);

💡 You can apply text watermarks to all pages or restrict them to specific page ranges using API parameters.


Watermark PDF using cURL

You can also use cURL to add text watermarks to PDF documents through REST API calls.

Step 1 – Obtain Access Token

curl -X POST "https://api.groupdocs.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded"

Step 2 – Add Text Watermark to PDF

curl -X POST "https://api.groupdocs.cloud/v1.0/watermark/pdf/add" -H "accept: application/json" -H "authorization: Bearer {ACCESS_TOKEN}" -H "Content-Type: application/json" -d '{
  "FileInfo": { "FilePath": "Sample.pdf" },
  "OutputPath": "output/output.pdf",
  "Text": "Confidential",
  "FontSize": 18,
  "Opacity": 0.3,
  "RotationAngle": 45,
  "HorizontalAlignment": "Center",
  "VerticalAlignment": "Center"
}'

Replace {ACCESS_TOKEN} with your actual token, and Sample.pdf with the uploaded PDF filename.


Watermark PDF Online Free

You can test this functionality instantly using our free Online Watermark PDF Tool. Upload your PDF document, type your watermark text, and download the watermarked file without writing a single line of code.

watermark pdf online

Add watermark to PDF online.


Conclusion

Adding a text watermark to your PDF documents using GroupDocs.Watermark Cloud SDK for .NET is a simple and efficient way to protect intellectual property, ensure authenticity, and enhance document branding. This REST API enables you to customize watermarks with font, style, color, and placement options programmatically.


Frequently Asked Questions – FAQs

1. Can I add text watermarks to all pages of a PDF?
Yes. You can apply the watermark to every page or specific page ranges.

2. Is it possible to adjust transparency and rotation?
Yes. The API supports watermark opacity, rotation angle, font size, and alignment customization.

3. Do I need any external software installed?
No. All operations run in the cloud, no desktop software required.

4. Can I add both image and text watermarks?
Yes. You can combine text and image watermarks in the same document.

5. Is there a free version of the watermark API?
Yes. Create a free trial account to test watermarking features online.