Petzold.PrintBanner.BannerDocumentPaginator.GetPage C# (CSharp) Method

GetPage() public method

public GetPage ( int numPage ) : System.Windows.Documents.DocumentPage
numPage int
return System.Windows.Documents.DocumentPage
        public override DocumentPage GetPage(int numPage)
        {
            DrawingVisual vis = new DrawingVisual();
            DrawingContext dc = vis.RenderOpen();

            double factor = Math.Min((PageSize.Width-96)/sizeMax.Width, (PageSize.Height-96)/sizeMax.Height);
            FormattedText formtxt = GetFormattedText(txt[numPage], face, factor*100);

            Point ptText = new Point((PageSize.Width - formtxt.Width)/2, (PageSize.Height - formtxt.Height)/2);
            dc.DrawText(formtxt, ptText);
            dc.Close();

            return new DocumentPage(vis);
        }
BannerDocumentPaginator