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

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            try
            {
                // ExStart:ExtractAnnotations
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Annotations();
                // Create PdfAnnotationEditor
                PdfAnnotationEditor annotationEditor = new PdfAnnotationEditor();
                // Open PDF document
                annotationEditor.BindPdf(dataDir + "ExtractAnnotations.pdf");
                // Extract annotations
                Enum[] annotType = { AnnotationType.FreeText, AnnotationType.Line };
                ArrayList annotList = (ArrayList)annotationEditor.ExtractAnnotations(1, 2, annotType);
                for (int index = 0; index < annotList.Count; index++)
                {
                    Annotation annotation = (Annotation)annotList[index];
                    Console.WriteLine(annotation.Contents);
                }
                // ExEnd:ExtractAnnotations
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
ExtractAnnotations