This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/csharp/editor/add-stamp-annotations-to-pdf.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Add stamp annotations in C# | Nutrient .NET SDK

Use stamp annotations to mark document state in PDF workflows.

Common use cases include:

  • Approval and rejection workflows
  • Draft and final document marking
  • Confidentiality labeling
  • Quality control and review tracking

In this guide, you’ll add:

  • Default and custom stamp styles
  • Color-customized stamps
  • Multiple status stamps on one page
Download sample

How Nutrient helps

Nutrient .NET SDK handles stamp annotation structures and appearance generation.

The SDK handles:

  • Stamp annotation dictionaries and icon rendering
  • Stamp appearance streams and text positioning
  • Stamp style resources and icon loading
  • Appearance state and color transformations

Complete implementation

This example adds several stamp annotations to a PDF file:

using Nutrient;

Working with stamp annotations

Open the document with using statements(opens in a new tab) so resources are cleaned up after processing.

Then:

  • Create a PDF editor.
  • Get the page collection.
  • Add a letter-size page (612 × 792) if the document is empty.
  • Get the annotation collection from the first page.
try
{
using Document document = Document.Open("input.pdf");
using PdfEditor editor = PdfEditor.Edit(document);
PdfPageCollection pages = editor.PageCollection;
if (pages.Count == 0)
{
pages.Add(612.0f, 792.0f);
}
PdfPage page = pages.First ?? throw new InvalidOperationException("The document has no pages.");
PdfAnnotationCollection annotations = page.AnnotationCollection;

Adding a basic stamp

Add a stamp with AddStamp(x, y, width, height, title, contents).

In this sample:

  • The position is (400, 700).
  • The size is 150 × 50.
  • The default style is Draft.
  • The default color is red (ARGB 255, 255, 0, 0).
PdfStampAnnotation draftStamp = annotations.AddStamp(
400.0f, 700.0f, 150.0f, 50.0f, // x, y, width, height
"Author",
"Work in progress"
);

Adding an approved stamp

Add a second stamp and customize its style.

This sample:

  • Adds a stamp at (400, 600).
  • Sets the stamp style to PdfRubberStampIcon.Approved with StampStyle.
  • Sets the color to green with Color.FromArgb(255, 0, 128, 0).
PdfStampAnnotation approvedStamp = annotations.AddStamp(
400.0f, 600.0f, 150.0f, 50.0f, // x, y, width, height
"Approver Name",
"Document approved on review"
);
// Customize the stamp appearance
approvedStamp.StampStyle = PdfRubberStampIcon.Approved;
approvedStamp.Color = Color.FromArgb(255, 0, 128, 0);

Adding a confidential stamp

Add a confidentiality stamp and set its icon style.

This sample sets:

  • The position to (400, 500).
  • The stamp style to PdfRubberStampIcon.Confidential.

The stamp keeps the default red color unless you set a different color:

PdfStampAnnotation confidentialStamp = annotations.AddStamp(
400.0f, 500.0f, 150.0f, 50.0f, // x, y, width, height
"Security Officer",
"Contains sensitive information"
);
// Customize the stamp appearance
confidentialStamp.StampStyle = PdfRubberStampIcon.Confidential;

Other available stamp types

Use other PdfRubberStampIcon values to represent more states.

This sample adds:

  • A NotApproved stamp at (50, 700).
  • A Final stamp at (50, 600) with the color blue (ARGB 255, 0, 0, 255).
// Not Approved stamp
PdfStampAnnotation notApprovedStamp = annotations.AddStamp(
50.0f, 700.0f, 150.0f, 50.0f, // x, y, width, height
"Reviewer",
"Rejected"
);
notApprovedStamp.StampStyle = PdfRubberStampIcon.NotApproved;
// Final stamp
PdfStampAnnotation finalStamp = annotations.AddStamp(
50.0f, 600.0f, 150.0f, 50.0f, // x, y, width, height
"Legal",
"Final version"
);
finalStamp.StampStyle = PdfRubberStampIcon.Final;
finalStamp.Color = Color.FromArgb(255, 0, 0, 255);

Saving the document

Save the output PDF.

The catch block catches NutrientException if processing fails:

editor.SaveAs("output.pdf");
Console.WriteLine("Successfully saved output.pdf");
}
catch (NutrientException e)
{
Console.Error.WriteLine($"Error: {e.Message}");
Environment.Exit(1);
}

Conclusion

Use this workflow to add stamp annotations:

  1. Open the document with using statements for automatic resource cleanup.
  2. Create an editor and access the page collection.
  3. Ensure at least one page exists by adding a letter-size page if needed.
  4. Retrieve the annotation collection for the target page.
  5. Add basic stamp annotations with the default Draft style and red color.
  6. Customize stamp styles using StampStyle with PdfRubberStampIcon enumeration values.
  7. Customize stamp colors using the Color property with ARGB color values.
  8. Add Approved stamps with green color for approval workflows.
  9. Add Confidential stamps for marking sensitive documents.
  10. Add NotApproved stamps for rejection indicators.
  11. Add Final stamps to mark completed documents.
  12. Save the document — the using statements release the native handles.

For related annotation workflows, refer to the .NET SDK annotation guides.