---
title: "Stamp a PDF document in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/annotations/stamp-a-document/"
md_url: "https://www.nutrient.io/guides/dotnet/annotations/stamp-a-document.md"
last_updated: "2026-05-21T17:12:02.199Z"
description: "Learn how to stamp PDF documents programmatically in C# .NET using Nutrient .NET SDK. Add custom stamps, watermarks, or overlays to your PDFs."
---

# Stamp a PDF document in C# .NET

To stamp a PDF document in the form of a PDF annotation, follow the steps below:

1. Create a `GdPicturePDF` object.

2. Load the PDF file with the [`LoadFromFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html).

3. Set the origin of the coordinate system with the [`SetOrigin` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetOrigin.html). This method requires the [`PDFOrigin` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfOrigin.html).

4. Set the measurement unit with the [`SetMeasurementUnit` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetMeasurementUnit.html) to specify the annotation’s dimensions and position. This method uses the [`PdfMeasurementUnit` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfMeasurementUnit.html).

5. Select the PDF page where you want to place the stamp annotation using the [`SelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SelectPage.html).

6. Add the stamp annotation using the [`AddStampAnnotation` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddStampAnnotation.html). This method uses the following parameters:
   - `Left` — The X coordinate of the top-left corner.
   - `Top` — The Y coordinate of the top-left corner.
   - `Width` — The width of the stamp annotation.
   - `Height` — The height of the stamp annotation.
   - `Title` — The title of the newly added stamp annotation object. By convention, it represents the author.
   - `Contents` — The text displayed in the annotation’s note.
   - `StampStyle` — A member of the [`PdfRubberStampAnnotationIcon` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfRubberStampAnnotationIcon.html) that specifies the appearance of the stamp.
   - The annotation icon’s color expressed with the `Red`, `Green`, and `Blue` parameters represented in RGB values (from `0` to `255`).

7. Save the PDF document to a file with the [`SaveToFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SaveToFile.html).

To add an “approve” stamp annotation to the last page of a PDF, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Set the origin of the coordinate system to the bottom-left corner.
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomLeft);
// Set the measurement unit to centimeters.
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter);
// Select the page where to attach the file.
gdpicturePDF.SelectPage(gdpicturePDF.GetPageCount());
// Add an annotation with the image file.
gdpicturePDF.AddStampAnnotation(Left: 5, Top: 5, Width: 5, Height: 2,
    "Nutrient", "Approved", PdfRubberStampAnnotationIcon.Approved,
    0.75f, 173, 216, 230);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Set the origin of the coordinate system to the bottom-left corner.
    gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomLeft)
    ' Set the measurement unit to centimeters.
    gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
    ' Select the page to attach the file to.
    gdpicturePDF.SelectPage(gdpicturePDF.GetPageCount())
    ' Add an annotation with the image file.
    gdpicturePDF.AddStampAnnotation(Left:=5, Top:=5, Width:=5, Height:=2,
        "Nutrient", "Approved", PdfRubberStampAnnotationIcon.Approved,
        0.75F, 173, 216, 230)
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

- [`AddStampAnnotation`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~AddStampAnnotation.html)

- [`GetPageCount`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~GetPageCount.html)

- [`LoadFromFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html)

- [`SaveToFile`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SaveToFile.html)

- [`SelectPage`](/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager~SelectPage.html)

- [`SetMeasurementUnit`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetMeasurementUnit.html)

- [`SetOrigin`](/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~SetOrigin.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Custom annotations](/guides/dotnet/annotations/custom-annotations.md)
- [Annotate on images in C# .NET](/guides/dotnet/annotations/annotate-on-images.md)
- [Attach an image to an annotation in C#](/guides/dotnet/annotations/attach-an-image.md)
- [Attach a file to an annotation in C#](/guides/dotnet/annotations/attach-a-file.md)
- [Create an annotation in a PDF using C#](/guides/dotnet/annotations/create.md)
- [Edit PDF annotations in C#](/guides/dotnet/annotations/edit.md)
- [Export XMP annotation data in C# .NET](/guides/dotnet/annotations/export-xmp.md)
- [Export annotation data from PDFs in C# .NET](/guides/dotnet/annotations/export-pdf.md)
- [Flatten PDF annotations in C# .NET](/guides/dotnet/annotations/flatten.md)
- [Get PDF annotation properties in C# .NET](/guides/dotnet/annotations/get-properties.md)
- [Import XFDF annotation data to PDFs in C# .NET](/guides/dotnet/annotations/import-xfdf.md)
- [Remove PDF annotations in C# .NET](/guides/dotnet/annotations/remove.md)
- [PDF annotations in C#.NET](/guides/dotnet/annotations.md)
- [Add PDF actions using C# in form fields](/guides/dotnet/annotations/pdf-actions-support.md)
- [Import XMP annotation data to PDF or image in C#](/guides/dotnet/annotations/import-xmp.md)
- [XMP annotations in C# .NET](/guides/dotnet/annotations/xmp-annotations.md)

