Provides data for the E:Patagames.Pdf.Net.Controls.Wpf.PdfPrint.PagePrinted event.
Inheritance: System.EventArgs
Exemple #1
0
 /// <summary>
 /// Raises the <see cref="PagePrinted"/> event.
 /// </summary>
 /// <param name="e">An <see cref="PagePrintedEventArgs"/> that contains the event data.</param>
 protected virtual void OnPagePrinted(PagePrintedEventArgs e)
 {
     if (PagePrinted != null)
     {
         PagePrinted(this, e);
     }
 }
Exemple #2
0
 private void Paginator_PagePrinted(object sender, PagePrintedEventArgs e)
 {
     OnPagePrinted(e);
     if (IsEnd)
     {
         e.Cancel = true;
     }
 }
Exemple #3
0
        public override DocumentPage GetPage(int pageNumber)
        {
            pageNumber = pageNumber + _pageRange.PageFrom - 1;

            if (_prevPage != null)
            {
                _prevPage.Dispose();
            }

            double w = _doc.Pages[pageNumber].Width;
            double h = _doc.Pages[pageNumber].Height;

            if (PageRotation(_doc.Pages[pageNumber]) == PageRotate.Rotate270 ||
                PageRotation(_doc.Pages[pageNumber]) == PageRotate.Rotate90)
            {
                var t = w; w = h; h = t;
                PrinterTicket.PageOrientation = PageOrientation.ReverseLandscape;
            }

            var visual = new DrawingVisual();
            var page   = new DocumentPage(visual);

            page.PageDestroyed += Page_PageDestroyed;
            RenderPage(pageNumber, visual);
            _prevPage = page;


            if (PagePrinted != null)
            {
                var args = new PagePrintedEventArgs(pageNumber - _pageRange.PageFrom + 1, _pageCount);
                PagePrinted(this, args);
                if (args.Cancel)
                {
                    _pageCount = 0;
                }
            }

            return(page);
        }
		public override DocumentPage GetPage(int pageNumber)
		{
			pageNumber = pageNumber + _pageRange.PageFrom - 1;

			if (_prevPage != null)
				_prevPage.Dispose();

			double w = _doc.Pages[pageNumber].Width;
			double h = _doc.Pages[pageNumber].Height;
			if (PageRotation(_doc.Pages[pageNumber]) == PageRotate.Rotate270
				|| PageRotation(_doc.Pages[pageNumber]) == PageRotate.Rotate90)
			{
				var t = w; w = h; h = t;
				PrinterTicket.PageOrientation = PageOrientation.ReverseLandscape;
			}

			var visual = new DrawingVisual();
			var page = new DocumentPage(visual);
			page.PageDestroyed += Page_PageDestroyed;
			RenderPage(pageNumber, visual);
			_prevPage = page;


			if (PagePrinted != null)
			{
				var args = new PagePrintedEventArgs(pageNumber - _pageRange.PageFrom + 1, _pageCount);
				PagePrinted(this, args);
				if (args.Cancel)
					_pageCount = 0;
			}

			return page;
		}
Exemple #5
0
		private void Paginator_PagePrinted(object sender, PagePrintedEventArgs e)
		{
			OnPagePrinted(e);
			if (IsEnd)
				e.Cancel = true;
		}
Exemple #6
0
		/// <summary>
		/// Raises the <see cref="PagePrinted"/> event.
		/// </summary>
		/// <param name="e">An <see cref="PagePrintedEventArgs"/> that contains the event data.</param>
		protected virtual void OnPagePrinted(PagePrintedEventArgs e)
		{
			if (PagePrinted != null)
				PagePrinted(this, e);
		}