0

I'm using PrintDocument to print out multiple pages that each have one control on. So far I'm able to print them all out on individual sheets as desired, however I'm unable to center the controls in the middle of the pages and it always shows in the top corner of the page. I'll post my code below.

                var dialog = new PrintDialog();
                var queue = GetPrinterQueue(pPrinterId);

                if (queue == null)
                    return;

                dialog.PrintQueue = queue;
                dialog.PrintTicket.PageOrientation = paperOrientation
                    ? PageOrientation.Portrait
                    : PageOrientation.Landscape;

                var document = new FixedDocument();
                var fixedPage = new FixedPage();

                fixedPage.Children.Add(front);
                //fixedPage.Measure(size);
                //fixedPage.Arrange(new Rect());
                //fixedPage.UpdateLayout();

                var pageContent = new PageContent();
                ((IAddChild)pageContent).AddChild(fixedPage);
                document.Pages.Add(pageContent);

                dialog.PrintDocument(document.DocumentPaginator, "Badge");

That is the bare minimum to make it print out a control per sheet, to make it simpler I have taken out the parts that print to different pages, for the sake of this it only needs to print one.

I've tried changing what is passed into .Arrange() and it makes no difference, what am I missing?

Thanks

H.B.
  • 166,899
  • 29
  • 327
  • 400
Murphybro2
  • 2,207
  • 1
  • 22
  • 36

0 Answers0