public FixedDocument CreateFixedDocument(PrintProcessorCollection collection)
        {
            FixedDocument = new FixedDocument();

            if (collection != null)
            {
                foreach (var pp in collection)
                {
                    var currentPage = FixedDocument.Pages.Count;
                    _printProcessor   = pp;
                    CurrentPageNumber = 1;
                    _printProcessor   = pp;
                    IList <IPrintContent> itemCollection = _printProcessor.ItemCollection().ToList();

                    AddItems(itemCollection);
                    if (collection.IndividualPageNumbers)
                    {
                        AddPageNumbers(currentPage);
                    }
                }

                if (!collection.IndividualPageNumbers)
                {
                    AddPageNumbers();
                }
            }
            return(FixedDocument);
        }
 public TestPrintController(IPrintProcessor printProcessor, IOptions <APIUrl> APIUrlOptions,
                            ICommandProcessor commandProcessor)
 {
     _printProcessor   = printProcessor;
     _APIUrlOptions    = APIUrlOptions;
     _commandProcessor = commandProcessor;
 }
        public FixedDocument CreateFixedDocument(PrintProcessorCollection collection)
        {
            FixedDocument = new FixedDocument();

            if (collection != null)
            {
                foreach (var pp in collection)
                {
                    var currentPage = FixedDocument.Pages.Count;
                    _printProcessor   = pp;
                    CurrentPageNumber = 1;
                    _printProcessor   = pp;
                    IList <IPrintContent> itemCollection = _printProcessor.ItemCollection().ToList();

                    AddItems(itemCollection);
                    if (collection.IndividualPageNumbers)
                    {
                        AddPageNumbers(currentPage);
                    }

                    for (int i = currentPage,
                         j = 1;
                         i < FixedDocument.Pages.Count;
                         i++, j++)
                    {
                        AddCustomPositionedContent(FixedDocument.Pages[i], _printProcessor.GetCustomPageContent(j));
                    }
                }

                if (!collection.IndividualPageNumbers)
                {
                    AddPageNumbers();
                }
            }
            return(FixedDocument);
        }
Пример #4
0
 public OpenCommandPrintController(IPrintProcessor processor) => _processor = processor;
 public PrintController(IPrintProcessor processor) => _processor = processor;
 private InternalPrintProcessor(IPrintProcessor printProcessor, FixedDocument fixedDocument)
 {
     _printProcessor = printProcessor;
     _fixedDocument  = fixedDocument;
     _pageHelper     = CreateNewPageHelper();
 }