Пример #1
0
        public void Process()
        {
            Pipeline pipeline = _context.GetPipeline();

            pipeline.Input($"{_context.InputFilePrefix}.pdf")
            .StageProcess(FindBlocksets);

            pipeline.Input($"{_context.InputFilePrefix}.pdf")
            .Output($"{_context.OutputFilePrefix}-stage2-blocksets.pdf")
            .StageProcess(ShowColors);

            _context.AddOutput("stage2-blocksets", $"{_context.OutputFilePrefix}-stage2-blocksets.pdf");
        }
Пример #2
0
        public void Process()
        {
            Pipeline pipeline = _context.GetPipeline();

            var result = pipeline.Input($"{_context.InputFilePrefix}.pdf")
                         .AllPages <CreateTextLines>(GetLines)
                         .ConvertText <CreateTextLineIndex, TextLine>(true)
                         .ConvertText <PreCreateStructures, TextLine2>()
                         .ConvertText <CreateStructures3, TextStructure>()
                         .ConvertText <PreCreateTextSegments, TextStructureAgg>()
                         .ConvertText <AggregateStructures, TextStructure>(true)
                         .ShowPdf <ShowStructureCentral>($"{_context.OutputFilePrefix}-show-central.pdf")
                         .Log <AnalyzeStructures>($"{_context.OutputFilePrefix}-analyze-structures.txt")
                         .Log <AnalyzeStructuresCentral>($"{_context.OutputFilePrefix}-analyze-structures-central.txt");

            _context.SetPipelineText <TextStructure>(result);

            _context.AddOutput("show-central", $"{_context.OutputFilePrefix}-show-central.pdf");
        }
        public void Process()
        {
            string   basename = _context.Basename;
            Pipeline pipeline = _context.GetPipeline();

            var page = pipeline.Input($"{_context.InputFilePrefix}.pdf")
                       .Page(1)
                       .ParsePdf <ProcessPdfText>()
                       .ParseBlock <ExtractDouHeaderInfo>();

            var    extract   = page.CreateInstance <ExtractDouHeaderInfo>();
            var    infoStats = extract.InfoStats;
            string content   = infoStats.ToString();

            var filename = _context.CreateGlobalInstance <InjectFilename>();

            filename.Filename  = _context.Basename;
            filename.InfoStats = infoStats;

            _context.WriteFile("header", $"{_context.OutputFilePrefix}-header.txt", content);
        }