Save a file from the annotation manager in C#

To PDF

To save a document created with the AnnotationManager class to a PDF file with GdPicture XMP annotation support, use the SaveDocumentToPDF method. It can save the document to a file or a Stream object

and uses the file path as a string or a Stream object as its parameter.

To include the annotations in the document’s content, use the BurnAnnotationsToPage method.

To save a PDF file from the AnnotationManager object, use the following code:

using AnnotationManager annotationManager= new AnnotationManager();
// Load a PDF file to the `AnnotationManager` object.
annotationManager.InitFromFile(@"C:\temp\source.pdf");
// Select the first page.
annotationManager.SelectPage(1);
// Create an `AnnotationRubberStamp` object.
GdPicture14.Annotations.AnnotationRubberStamp stamp;
// Add the stamp to the `AnnotationManager` object.
stamp = annotationManager.AddRubberStampAnnot(Color.Red,
0.5f, 0.5f, 2, 1, "APPROVED");
stamp.Rotation = 20;
// Save the annotation to the `AnnotationManager` object.
annotationManager.SaveAnnotationsToPage();
// Flatten the annotation.
annotationManager.BurnAnnotationsToPage(false);
// Save the document as a PDF file.
annotationManager.SaveDocumentToPDF(@"C:\temp\output.pdf", 100);