WPF PrintDialog.PrintVisual() doesn't print All the pages RRS feed

  • Question

  • I am developing the WPF application to print WPF window contents. I am trying to print the WPF window [.xaml page] which contains the more than one pages of information.  I am using the below lines of code to print the WPF window content.  

    Sample code: 
    PrintDialog printDialog = new PrintDialog();
    printDialog.PageRangeSelection = PageRangeSelection.AllPages;
    printDialog.UserPageRangeEnabled =true;
    if (printDialog.ShowDialog() == true )
    printDialog.PrintVisual(XamlPage,"Test Print");
    where XamlPage is the .xaml page.

    It works fine for single page.  But it doesn't work, whenever I've tried to print the more than one page.   

    Is there any way to print all the pages. 

    Wednesday, January 7, 2009 2:21 AM