Beispiel #1
0
        /// <summary>
        /// Print a job
        /// </summary>
        public void Print(GetPageCallback getPage, string jobName)
        {
            try
            {
                if (getPage == null)
                {
                    throw new ArgumentNullException("getPage");
                }

                this.StartDoc(jobName);

                int pageNo = 0;

                Visual visual = getPage(this);

                while (!_cancel && (visual != null))
                {
                    string uri = this.StartPage(pageNo);

                    this.Render(visual, uri);
                    this.EndPage();

                    pageNo++;

                    visual = getPage(this);
                }

                this.EndDoc();
            }
            finally
            {
                // restore normal batching
                MediaContext.CurrentMediaContext.ChannelSyncMode = false;

                _stream = null;
                _writer = null;

                _eDocRendition = null;
                _eDocJob       = null;
            }
        }
Beispiel #2
0
 public PageNode(Experience owner, StringId id, GetPageCallback handler, SQMDataId sqmDataID)
     : base(owner, id, null, sqmDataID)
     => this._handler = handler;