---
title: "Load any file for annotation manager in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/load-a-file/annotation-any-file/"
md_url: "https://www.nutrient.io/guides/dotnet/load-a-file/annotation-any-file.md"
last_updated: "2026-05-15T19:10:04.988Z"
description: "Discover how to annotate any file type in .NET, including streams and XML. Boost your file handling skills with our comprehensive guide."
---

# Load any file for the annotation manager in C#

### Any File

[Any File](https://www.nutrient.io/guides/dotnet/load-a-file/annotation-any-file.md)

### Stream

[Stream](https://www.nutrient.io/guides/dotnet/load-a-file/annotation-stream.md)

### XML

[XML](https://www.nutrient.io/guides/dotnet/load-a-file/annotation-xml.md)

To load a supported file into the [`AnnotationManager` class](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager.html), use the [`InitFromFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.AnnotationManager~InitFromFile.html).

`InitFromFile` takes a full file path and returns a `GdPictureStatus`, which should be checked before working with annotations.

The list of supported formats is available on the [supported file types](https://www.nutrient.io/guides/dotnet/about/file-type-support.md) page.

The `AnnotationManager` only handles GdPicture annotations and XMP annotations contained in the source document.

To load a file into `AnnotationManager`, add an annotation, and save the result, use the following code:

In some cross-platform GdPicture.API (net8.0) setups, `AnnotationManager.AddRubberStampAnnot(...)` expects `GdPicture14.Imaging.GdPictureColor` rather than `System.Drawing.Color`. If `Color.Red` from `System.Drawing` causes a type mismatch, use a `GdPictureColor` value instead (for example, `GdPictureColor.Red` or `GdPicture14.Imaging.GdPictureColor.Red`) or explicitly construct a `GdPictureColor`.

### 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.BurnAnnotationsToPage(false);
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"BurnAnnotationsToPage failed: {status}");
    return;
}

status = annotationManager.SaveDocumentToJPEG(@"C:\temp\output.jpg", 100);
if (status!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveDocumentToJPEG 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.BurnAnnotationsToPage(False)
    If status <> GdPictureStatus.OK Then
        Console.WriteLine($"BurnAnnotationsToPage failed: {status}")
        Return
    End If

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

```
---

## Related pages

- [Load an XML file for the annotation manager in C#](/guides/dotnet/load-a-file/annotation-xml.md)
- [Load a stream for the annotation manager in C#](/guides/dotnet/load-a-file/annotation-stream.md)
- [Load files in C#](/guides/dotnet/load-a-file.md)

