public PipelinePage ParsePdf <T>()
                where T : class, IEventListener, IPipelineResults <BlockPage>, new()
            {
                var listener = CreateInstance <T>();

                var parser = new PdfCanvasProcessor(listener);

                parser.ProcessPageContent(_pdfPage);

                // retrieve page size. where to store?
                var pageSize = _pdfPage.GetPageSize();

                var page = new PipelinePage(_pdf, _pageNumber);

                page.LastResult = listener.GetResults();

                if (page.LastResult == null)
                {
                    throw new InvalidOperationException();
                }

                if (page.LastResult.AllBlocks == null)
                {
                    throw new InvalidOperationException();
                }

                _page = page;

                return(page);
            }
            public PipelinePage FromCache <T>()
                where T : class, IProcessBlockData
            {
                var page = new PipelinePage(_pdf, _pageNumber);

                _page = page.FromCache <T>();

                return(_page);
            }
Esempio n. 3
0
        public PipelinePage ShowErrors(Action <PipelinePage> callback)
        {
            var newpage = new PipelinePage((PipelineInputPdf)this.Context, this.PageNumber);

            var errors = this.LastErrors;

            newpage.LastResult = errors;
            newpage.LastErrors = errors;

            callback(newpage);

            return(this);
        }
Esempio n. 4
0
 static public PipelinePage ShowLine(this PipelinePage page, Color color)
 {
     PipelineDebug.ShowLine((PipelineInputPdf)page.Context, page.LastResult, color);
     return(page);
 }
Esempio n. 5
0
 static public PipelinePage DebugBreak(this PipelinePage page, Func <PipelinePage, bool> condition = null)
 {
     PipelineDebug.DebugBreak(page, condition);
     return(page);
 }
Esempio n. 6
0
 static public PipelinePage Output(this PipelinePage page, string filename)
 {
     PipelineDebug.Output((PipelineInputPdf)page.Context, filename);
     return(page);
 }