Reputation: 20717
I want to print a Framework element on a paper.
I'm currently having this:
public static void Print(FrameworkElement frameworkElement)
{
PrintDialog dialog = new PrintDialog();
if (dialog.ShowDialog() != true)
return;
frameworkElement.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
frameworkElement.Arrange(new Rect(new Point(0, 0), frameworkElement.DesiredSize));
dialog.PrintVisual(frameworkElement, "A Great Image.");
}
but with this, my components doesn't takes the whole page, which is normal, because we ask him to paint with his desired size.
My second question about printing:
Can I do ONE print task, but print several components(one on each page?)
Thank you!
Upvotes: 1
Views: 2581