Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

wpf c# wanted the page number to be at any of the four corners of the page

$
0
0

wpf c# wanted the page number to be at any of the four corners of the page

 paginator = new DocumentPaginatorWrapper(paginator, new Size(8.5 * 96, 11 * 96), new Size(48, 48));

 public override DocumentPage GetPage(int pageNumber)
            {

                DocumentPage page = m_Paginator.GetPage(pageNumber);

                // Create a wrapper visual for transformation and add extras


                ContainerVisual newpage = new ContainerVisual();
                DrawingVisual title = new DrawingVisual();
                using (DrawingContext ctx = title.RenderOpen())
                {

                    if (m_Typeface == null)
                    {

                        //  m_Typeface = new Typeface(fontFamily2);
                        m_Typeface = new Typeface("Arial");

                    }


                    FormattedText text = new FormattedText("Page " + (pageNumber + 1),

                        System.Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight,

                        m_Typeface, 14, Brushes.Black);
                    ctx.DrawText(text, new Point(0, -96 / 4)); // 1/4 inch above page content
                    //ctx.DrawText(text, new Point(96 * 0.25, 96 * 0.25));

                    // ctx.DrawText(text, new Point(768, 860 )); // 1/4 inch above page content


                }


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>