Load any file for the annotation manager in C#

Any File

To load any type of file to the AnnotationManager object, use the InitFromFile method. This method requires the full path to a file as its parameter.

The list of supported file formats is available on the Supported File Types page.

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

To load an image file to the AnnotationManager object, use the following code:

using AnnotationManager annotationManager= new AnnotationManager();
// Load an image to the `AnnotationManager` object.
annotationManager.InitFromFile(@"C:\temp\source.jpg");
// 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 into the image.
annotationManager.BurnAnnotationsToPage(false);
// Save the image with the annotation.
annotationManager.SaveDocumentToJPEG(@"C:\temp\output.jpg", 100);