Exemple #1
0
            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);
            }
Exemple #2
0
            public PipelinePage FromCache <T>()
                where T : class, IProcessBlockData
            {
                var page = new PipelinePage(_pdf, _pageNumber);

                _page = page.FromCache <T>();

                return(_page);
            }
Exemple #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);
        }
Exemple #4
0
 static public PipelinePage ShowLine(this PipelinePage page, Color color)
 {
     PipelineDebug.ShowLine((PipelineInputPdf)page.Context, page.LastResult, color);
     return(page);
 }
Exemple #5
0
 static public PipelinePage DebugBreak(this PipelinePage page, Func <PipelinePage, bool> condition = null)
 {
     PipelineDebug.DebugBreak(page, condition);
     return(page);
 }
Exemple #6
0
 static public PipelinePage Output(this PipelinePage page, string filename)
 {
     PipelineDebug.Output((PipelineInputPdf)page.Context, filename);
     return(page);
 }