---
title: "Save a file from the annotation manager in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-xmp/"
md_url: "https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-xmp.md"
last_updated: "2026-05-26T01:23:09.637Z"
description: "Discover how to save annotations as JPG, PDF, TIFF, and XMP files with our step-by-step guide for .NET developers."
---

# Save a file from the annotation manager in C#

### To JPG

[To JPG](https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-jpg.md)

### To PDF

[To PDF](https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-pdf.md)

### To TIFF

[To TIFF](https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-tiff.md)

### To XMP

[To XMP](https://www.nutrient.io/guides/dotnet/save-a-file/annotation-to-xmp.md)

Nutrient.NET SDK (formerly GdPicture.NET) lets you export GdPicture/XMP annotations with the [`SaveAnnotationsToXMP` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager~SaveAnnotationsToXMP.html) and the [`SaveAnnotationsToXMPEx` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager~SaveAnnotationsToXMPEx.html).

You can use these methods to:

- [Save annotations from an image](#saving-annotations-from-an-image)

- [Save annotations from one specific page of a multipage document](#saving-annotations-from-a-specific-page)

- [Save annotations from all pages of a multipage document](#saving-annotations-from-all-pages)

## Saving annotations from an image

To save annotations from an image to XML (file or stream), use `SaveAnnotationsToXMP`.

### C#

```csharp

using GdPicture14;
using GdPicture14.Annotations;
using System;
using System.Drawing;

using AnnotationManager annotationManager = new AnnotationManager();

GdPictureStatus status = annotationManager.InitFromFile(@"C:\temp\source.jpg");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"InitFromFile failed: {status}");
    return;
}

AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(
    Color.Red,
    0.5f,
    0.5f,
    2,
    1,
    "APPROVED");

if (stamp == null)
{
    Console.WriteLine("AddRubberStampAnnot failed.");
    return;
}

stamp.Rotation = 20;

status = annotationManager.SaveAnnotationsToPage();
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToPage failed: {status}");
    return;
}

status = annotationManager.SaveAnnotationsToXMP(@"C:\temp\output.xml");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToXMP failed: {status}");
}

```

### VB.NET

```vb

Imports GdPicture14
Imports GdPicture14.Annotations
Imports System.Drawing

Using annotationManager As New AnnotationManager()
    Dim status As GdPictureStatus = annotationManager.InitFromFile("C:\temp\source.jpg")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"InitFromFile failed: {status}")
        Return
    End If

    Dim stamp As AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(
        Color.Red,
        0.5F,
        0.5F,
        2,
        1,
        "APPROVED")

    If stamp Is Nothing Then
        Console.WriteLine("AddRubberStampAnnot failed.")
        Return
    End If

    stamp.Rotation = 20

    status = annotationManager.SaveAnnotationsToPage()
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToPage failed: {status}")
        Return
    End If

    status = annotationManager.SaveAnnotationsToXMP("C:\temp\output.xml")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToXMP failed: {status}")
    End If
End Using

```

## Saving annotations from a specific page

To save annotations from one page of a multipage document, select the page first, and then call `SaveAnnotationsToXMP`.

Use the [`SelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager~SelectPage.html) to choose the page in multipage formats like PDF or TIFF.

### C#

```csharp

using GdPicture14;
using GdPicture14.Annotations;
using System;
using System.Drawing;

using AnnotationManager annotationManager = new AnnotationManager();

GdPictureStatus status = annotationManager.InitFromFile(@"C:\temp\source.pdf");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"InitFromFile failed: {status}");
    return;
}

status = annotationManager.SelectPage(1);
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SelectPage failed: {status}");
    return;
}

AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5f, 0.5f, 2, 1, "APPROVED");
if (stamp == null)
{
    Console.WriteLine("AddRubberStampAnnot failed.");
    return;
}

stamp.Rotation = 20;

status = annotationManager.SaveAnnotationsToPage();
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToPage failed: {status}");
    return;
}

status = annotationManager.SaveAnnotationsToXMP(@"C:\temp\output.xml");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToXMP failed: {status}");
}

```

### VB.NET

```vb

Imports GdPicture14
Imports GdPicture14.Annotations
Imports System.Drawing

Using annotationManager As New AnnotationManager()
    Dim status As GdPictureStatus = annotationManager.InitFromFile("C:\temp\source.pdf")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"InitFromFile failed: {status}")
        Return
    End If

    status = annotationManager.SelectPage(1)
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SelectPage failed: {status}")
        Return
    End If

    Dim stamp As AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5F, 0.5F, 2, 1, "APPROVED")
    If stamp Is Nothing Then
        Console.WriteLine("AddRubberStampAnnot failed.")
        Return
    End If

    stamp.Rotation = 20

    status = annotationManager.SaveAnnotationsToPage()
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToPage failed: {status}")
        Return
    End If

    status = annotationManager.SaveAnnotationsToXMP("C:\temp\output.xml")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToXMP failed: {status}")
    End If
End Using

```

## Saving annotations from all pages

To save annotations from all pages of a multipage document, use `SaveAnnotationsToXMPEx`.

### C#

```csharp

using GdPicture14;
using GdPicture14.Annotations;
using System;
using System.Drawing;

using AnnotationManager annotationManager = new AnnotationManager();

GdPictureStatus status = annotationManager.InitFromFile(@"C:\temp\source.pdf");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"InitFromFile failed: {status}");
    return;
}

status = annotationManager.SelectPage(1);
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SelectPage failed: {status}");
    return;
}

AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5f, 0.5f, 2, 1, "APPROVED");
if (stamp == null)
{
    Console.WriteLine("AddRubberStampAnnot failed.");
    return;
}

stamp.Rotation = 20;

status = annotationManager.SaveAnnotationsToPage();
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToPage failed: {status}");
    return;
}

status = annotationManager.SaveAnnotationsToXMPEx(@"C:\temp\output.xml");
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAnnotationsToXMPEx failed: {status}");
}

```

### VB.NET

```vb

Imports GdPicture14
Imports GdPicture14.Annotations
Imports System.Drawing

Using annotationManager As New AnnotationManager()
    Dim status As GdPictureStatus = annotationManager.InitFromFile("C:\temp\source.pdf")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"InitFromFile failed: {status}")
        Return
    End If

    status = annotationManager.SelectPage(1)
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SelectPage failed: {status}")
        Return
    End If

    Dim stamp As AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5F, 0.5F, 2, 1, "APPROVED")
    If stamp Is Nothing Then
        Console.WriteLine("AddRubberStampAnnot failed.")
        Return
    End If

    stamp.Rotation = 20

    status = annotationManager.SaveAnnotationsToPage()
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToPage failed: {status}")
        Return
    End If

    status = annotationManager.SaveAnnotationsToXMPEx("C:\temp\output.xml")
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAnnotationsToXMPEx failed: {status}")
    End If
End Using

```
---

## Related pages

- [Save a file from the annotation manager in C#](/guides/dotnet/save-a-file/annotation-to-jpg.md)
- [Save a file from the annotation manager in C#](/guides/dotnet/save-a-file/annotation-to-pdf.md)
- [Save a file from the annotation manager in C#](/guides/dotnet/save-a-file/annotation-to-tiff.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging-remote-url.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging-bitmap.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging-byte-array.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging-ftp.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging.md)
- [Save PDF files in C#](/guides/dotnet/save-a-file/pdf-incremental.md)
- [Save images and PDF files in C#](/guides/dotnet/save-a-file.md)
- [Save PDF files in C#](/guides/dotnet/save-a-file/pdf-local-storage.md)
- [Save PDF files in C#](/guides/dotnet/save-a-file/pdf-incremental-to-stream.md)
- [Save PDF files in C#](/guides/dotnet/save-a-file/pdf-stream.md)
- [Save PDF files in C#](/guides/dotnet/save-a-file/pdf.md)
- [Save images in C#](/guides/dotnet/save-a-file/imaging-vector.md)

