WPF Reflections

Apr 11 2008   2:37PM GMT

Printing with WPF



Posted by: MarkWPF
Tags:
printing
WPF
XAML

How does printing work with WPF?

Well, actually, if anyone out there has ever worked with printing in MFC, then it’s so advanced as to make you dizzy.
Even if you ever tried printing with Windows Forms, then printing in WPF is a bit of a revelation.

So how does it work?

Most of the printing stuff is in the System.Printing namespace, and a good starting place is the PrintDialog class.
By instantiating the PrintDialog class, you can display the standard xp or vista print dialog to allow the user to choose where to print something and how.

What else does it give you?

You can call two different methods to do printing:
PrintVisual – allows you print any class that derives from System.Windows.Media.Visual – which is a lot :-)
PrintDocument – allows you to print any DocumentPaginator, e.g. FlowDocument or XpsDocument.

And it just works :-)

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: