This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/save-a-file/annotation-to-pdf.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Save a file from the annotation manager in C# .NET | Nutrient .NET SDK
To PDF

If you need to add annotations to a document and export the result as PDF, use the AnnotationManager class with the SaveDocumentToPDF method.

SaveDocumentToPDF overloads:

  • SaveDocumentToPDF(string FilePath)
  • SaveDocumentToPDF(Stream Stream)

This method saves with GdPicture/XMP annotation support and returns a GdPictureStatus.

To flatten the annotations while saving the document, call the BurnAnnotationsToPage method before saving.

To add an annotation and save as PDF, use the following code:

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;
}
if (annotationManager.PageCount == 0)
{
Console.WriteLine("Document contains no pages.");
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.BurnAnnotationsToPage(false);
if (status != GdPictureStatus.OK)
{
Console.WriteLine($"BurnAnnotationsToPage failed: {status}");
return;
}
status = annotationManager.SaveDocumentToPDF(@"C:\temp\output.pdf");
if (status != GdPictureStatus.OK)
{
Console.WriteLine($"SaveDocumentToPDF failed: {status}");
}