PrintManger.Print() Bug

Hi

There appears to be a bug in the behaviour of PrintManager.Print() for GoXam for Silverlight, 1.3.3.5.

The first time PrintManager.Print() is called the Print dialog is displayed… However, any subsequent calls to PrintManager.Print() fail to display the Print dialog.

See the XAML and code below and follow these steps to reproduce:

  1. Click on the ‘Print’ button. This will call PrintManager.Print(). When the Print dialog is displayed, click ‘Cancel’
  2. Click on the ‘Print’ button again. The Print dialog does not get displayed.

XAML:

<Grid x:Name="LayoutRoot" Background="White">

    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    
    
    <go:Diagram x:Name="ctlDiagram" />
    
    <Button Content="Print" x:Name="cmdPrint" Grid.Row="1" Click="cmdPrint_Click" />
    
</Grid>

Code Behind:

public partial class PrintTestView : UserControl
{
public PrintTestView()
{
InitializeComponent();
}

    private void cmdPrint_Click(object sender, RoutedEventArgs e)
    {
        ctlDiagram.PrintManager.Print();
    }
}

Thanks

I forgot to mention that this is for Silverlight 5

I have sent you mail about a new DLL.

I expect that we will be releasing it as a bug-fix release soon.

Thanks Walter

Hi Walter

I have a question regarding printing performance. I tried printing a simple diagram with 4 nodes and PrinterManager.PageOptions set to None.

I then looked at the print spooler and noticed that the print request being generated was 127MB!
The entire print process took about 30 seconds to execute and during this time my application was blocked. My concern is that my application is being blocked for so long.

I’m aware that Silverlight has printing limitations, so my questions are:

  1. Is it normal for such a large print request to be generated?
  2. Will I be able to put PrintManager.Print() into it’s own thread and is it safe to do so?

Thanks

  1. Yes. But I believe that it is faster in Silverlight 5 than it was in Silverlight 4.
    Try printing to a PostScript printer driver, if you have one handy – that should be a lot smaller.
  2. I doubt that that could work.