Aspose.Pdf.Examples.CSharp.AsposePDFFacades.Annotations.ExportAnnotations.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:ExportAnnotations
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Annotations();
            // Create PdfAnnotationEditor object
            PdfAnnotationEditor AnnotationEditor = new PdfAnnotationEditor();
            // Open PDF document
            AnnotationEditor.BindPdf(dataDir+ "ExportAnnotations.pdf");
            // Export annotations
            FileStream fileStream = new System.IO.FileStream(dataDir + "exportannotations.xfdf", System.IO.FileMode.Create);
            Enum[] annotType = { AnnotationType.FreeText, AnnotationType.Line };
            AnnotationEditor.ExportAnnotationsXfdf(fileStream, 1, 5, annotType);
            // Save output PDF
            AnnotationEditor.Save(dataDir+ "ExportAnnotations_out.pdf");
            fileStream.Flush();
            fileStream.Close();            
            // ExEnd:ExportAnnotations
        }
    }
ExportAnnotations