PrintDocument.Print Method (String, PrinterFallbackSettings, Boolean)


Starts the vector printing process for the specified document by optionally opening the print dialog box or printing directly to the default printer for trusted applications.

Namespace:  System.Windows.Printing
Assembly:  System.Windows (in System.Windows.dll)

public void Print(
	string documentName,
	PrinterFallbackSettings printerFallbackSettings,
	bool useDefaultPrinter


Type: System.String
The name of the document to print.
Type: System.Windows.Printing.PrinterFallbackSettings
The settings to use to enable vector printing for printers with limited support.
Type: System.Boolean
Whether or not to automatically print to the default printer for the computer without showing a print dialog. This parameter can only be true in trusted applications, otherwise an exception will occur.


The print operation is not user-initiated.


useDefaultPrinter is set to true and the application is not a trusted application.

In Silverlight 5 the printing defaults to vector printing. In Silverlight 4, the printing defaults to bitmap printing. You can specify bitmap printing in Silverlight 5 by using the PrintBitmap method.

Specify the output to print by handling the PrintPage event and by setting the PrintPageEventArgs.PageVisual property to the UIElement you wish to print. If you are printing items that are not in the visual tree, you should populate the UIElement with all its content before setting it to the PrintPageEventArgs.PageVisual.

If the user cancels the print operation, the BeginPrint and EndPrint events will not occur.


Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.