I am trying to print a WPF canvas on multiple pages.
I am very pleased with scaling it to fit the page, and then clipping and translating the canvas for each page; all pretty simple maths.
What I donβt understand is how I get the size of the printable area and how to tell the printer where to print. No matter what I try to do, the values ββI use are the paper size, and therefore I get cropping when the printer cannot print on the edge of the sheet.
var capabilities = printDialog.GetPrintCapabilities(dialog.PrintTicket);
possesses the following properties:
capabilities.PageImageableArea.ExtentWidth
What is the area of ββthe image? Is this an area on paper where I can post content? I think so because:
capabilities.PageImageableArea.OriginWidth
However, what about the bottom and right margins? Where can I find this information?
What should the PageSize property be set for the DocumentPaginator parameter? Should I install this from capabilities.PageImageableArea ? Or dialog.Print() function set this value and I just need to read it in GetPage() ?
Finally, when I return a DocumentPage , what do I pass the third arguments to the PageSize , bleedBox and contentBox ?
Thanks:)
source share