internal static void BuildReport(Library library, List <PDFDocument> pdf_documents)
        {
            AnnotationReportOptions annotation_report_options = new AnnotationReportOptions();

            List <AnnotationWorkGenerator.AnnotationWork> annotation_works = AnnotationWorkGenerator.GenerateAnnotationWorks(library, pdf_documents, annotation_report_options);

            IEnumerable <AnnotationJSON> annotation_jsons = annotation_works.Select(annotation_work =>
                                                                                    new AnnotationJSON
            {
                fingerprint = annotation_work.pdf_document.Fingerprint,
                title       = annotation_work.pdf_document.TitleCombined,
                page        = annotation_work.pdf_annotation.Page,
                left        = annotation_work.pdf_annotation.Left,
                top         = annotation_work.pdf_annotation.Top,
                width       = annotation_work.pdf_annotation.Width,
                height      = annotation_work.pdf_annotation.Height,
                tags        = annotation_work.pdf_annotation.Tags,
                text        = annotation_work.pdf_annotation.Text,
            }
                                                                                    );

            string json     = JsonConvert.SerializeObject(annotation_jsons, Formatting.Indented);
            string filename = Path.GetTempFileName() + ".json.txt";

            File.WriteAllText(filename, json);
            Process.Start(filename);
        }
Ejemplo n.º 2
0
        private void PopulateWithAnnotationReport(PDFDocument pdf_document)
        {
            List <PDFDocument> pdf_documents = new List <PDFDocument>();

            pdf_documents.Add(pdf_document);

            AnnotationReportOptions annotation_report_options = new AnnotationReportOptions();

            annotation_report_options.ObeySuppressedImages           = true;
            annotation_report_options.ObeySuppressedText             = true;
            annotation_report_options.SuppressAllImages              = false;
            annotation_report_options.SuppressAllText                = true;
            annotation_report_options.SuppressPDFDocumentHeader      = true;
            annotation_report_options.SuppressPDFAnnotationTags      = true;
            annotation_report_options.InitialRenderDelayMilliseconds = 1000;

            var annotation_report = AsyncAnnotationReportBuilder.BuildReport(pdf_document.Library, pdf_documents, annotation_report_options);

            ObjDocumentViewer.Document = annotation_report.flow_document;
        }
        private void PopulateWithAnnotationReport(PDFDocument pdf_document)
        {
            WPFDoEvents.AssertThisCodeIs_NOT_RunningInTheUIThread();

            List <PDFDocument> pdf_documents = new List <PDFDocument>();

            pdf_documents.Add(pdf_document);

            AnnotationReportOptions annotation_report_options = new AnnotationReportOptions();

            annotation_report_options.ObeySuppressedImages           = true;
            annotation_report_options.ObeySuppressedText             = true;
            annotation_report_options.SuppressAllImages              = false;
            annotation_report_options.SuppressAllText                = true;
            annotation_report_options.SuppressPDFDocumentHeader      = true;
            annotation_report_options.SuppressPDFAnnotationTags      = true;
            annotation_report_options.InitialRenderDelayMilliseconds = 1000;

            AsyncAnnotationReportBuilder.BuildReport(pdf_document.LibraryRef, pdf_documents, annotation_report_options, delegate(AsyncAnnotationReportBuilder.AnnotationReport annotation_report)
            {
                ObjDocumentViewer.Document = annotation_report.flow_document;
            });
        }