コード例 #1
0
        static PipelineText <TextLine> GetTextLines(string basename, string inputfolder, string outputfolder, out Execution.Pipeline pipeline)
        {
            string inputfile  = $"{inputfolder}/{basename}.pdf";
            string outputfile = $"{outputfolder}/{basename}-parser.pdf";

            return(Examples.GetTextLines(inputfile, outputfile, out pipeline));
        }
コード例 #2
0
        public static void ProcessStats(string basename)
        {
            //PdfWriteText.Test();
            //return;
            Console.WriteLine();
            Console.WriteLine("Program4 - Processing with hierachy");
            Console.WriteLine();

            // Extract(1);

            Examples.FollowText(basename);
            Examples.ShowHeaderFooter(basename);
            ExamplesWork.PrintAllSteps(basename, "bin", "bin");

            PdfReaderException.ContinueOnException();

            var conteudos = GetTextLinesWithPipelineBlockset(basename, out Execution.Pipeline pipeline)
                            .Log <AnalyzeLines>($"bin/{basename}-lines.txt")
                            .ConvertText <CreateStructures, TextStructure>()
                            .Log <AnalyzeStructuresCentral>($"bin/{basename}-central.txt")
                            //.PrintAnalytics($"bin/{basename}-print-analytics.txt")
                            .ConvertText <CreateTextSegments, TextSegment>()
                            .Log <AnalyzeSegmentTitles>($"bin/{basename}-tree.txt")
                            .Log <AnalyzeSegmentStats>($"bin/{basename}-segments-stats.txt")
                            .Log <AnalyzeSegments2>($"bin/{basename}-segments.csv")
                            .ConvertText <CreateTreeSegments, TextSegment>()
                            .ConvertText <TransformConteudo, Conteudo>()
                            .ToList();

            var validation = pipeline.Statistics.Calculate <ValidateFooter, StatsPageFooter>();

            //Create XML
            var createArticle = new TransformArtigo();
            var artigos       = createArticle.Create(conteudos);

            createArticle.CreateXML(artigos, basename);

            var validator = new ProgramValidatorXML();

            validator.ValidateArticle("bin");
        }