WPF Reflections

Apr 22 2008   3:25PM GMT

WPF Printing - why is it small



Posted by: Mark Shurmer
WPF, XAML, printing

When you get to printing in WPF, you will find it so much easier than printing in previous Microsoft UI design (ie Winforms and MFC). See a previous post of mine to see how easy.

One thing that does occur though, is that when you print your element/canvas/grid/whatever, it will usually go on the printer very small. Why is that?
Actually, I think it is a good thing :-)
What it means is that it’s printing exactly the same on the printer as on the screen, something we have been begging for, for ages [well since we’ve had GUI’s anyway].

So how can you make it bigger, well it’s pretty easy when you know how:

You simply make the element bigger by using a Transform before printing, like

grid.LayoutTransform = new ScaleTransform(6,6);
printDlg.PrintVisual(grid, “My vision”);

Comment on this Post


You must be logged-in to post a comment. Log-in/Register