Пример #1
0
        void InitDocument(PdfDocument document, PipelineFactory factory)
        {
            var globalStats = factory.CreateGlobalInstance <PipelineDocumentStats>();

            var page = document.GetPage(1);

            var rect = page.GetPageSize();

            globalStats.X      = rect.GetX();
            globalStats.H      = rect.GetY();
            globalStats.Height = rect.GetHeight();
            globalStats.Width  = rect.GetWidth();
        }
Пример #2
0
        public PipelineText(PipelineFactory factory, IPipelineContext context, IEnumerable <TT> stream, TransformIndexTree indexTree, IDisposable chain)
        {
            this.Context       = context;
            this.CurrentStream = stream;
            _tracker           = new PipelineDisposeHelper();
            _tracker.TrackInstance(chain);
            _indexTree = indexTree;
            _factory   = factory;

            if (FORCE_INMEMORY_PROCESS)
            {
                this.CurrentStream = stream.ToArray();
            }
        }
Пример #3
0
            public void Dispose()
            {
                PdfReaderException.ClearContext();

                if (_outputCanvas != null)
                {
                    _outputCanvas.Release();
                    _outputCanvas = null;
                }

                if (_factory != null)
                {
                    _factory.Dispose();
                    _factory = null;
                }
            }
Пример #4
0
        public PipelineFactory(PipelineFactory parentContext)
        {
            if (parentContext == null)
            {
                throw new ArgumentNullException(nameof(parentContext));
            }

            // At this time, there is no need to have multiple nested context
            // We limit this to one to prevent unecessary nesting
            // But we can review this policy later whenever needed
            if (parentContext._parentContext != null)
            {
                throw new InvalidOperationException("only single nested level is allowed at this time");
            }

            _parentContext = parentContext;
            _scope         = CreateScope();
        }
Пример #5
0
 public PipelineFactory()
 {
     _parentContext = null;
     _scope         = CreateScope();
 }
Пример #6
0
 public Pipeline(PipelineFactory factory)
 {
     _factory = factory;
 }
Пример #7
0
 public Pipeline()
 {
     _factory = new PipelineFactory();
 }
Пример #8
0
 public Pipeline(PipelineFactory factory, IConfigurationStore configurationStore)
 {
     _factory     = factory;
     _configStore = configurationStore;
 }