WPF Reflections

I have blogged before on how you print a WPF element using the PrintVisual method in the PrintDialog class, which is very flexible as it will print any element derived from Systems.Windows.Media.Visual.
However, there is another weapon in the PrintDialog armoury, and that is the ability to print documents. Given the extensive document support in WPF, it comes as no surprise that you can easily print these documents.

To do that you need to get at the DocumentPaginator object – it’s purpose in life lies in managing content as pages which is just perfect for the job.
You get at it by using the IDocumentPaginatorSource interface, like this:

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

Processing your reply...

There was an error processing your information. Please try again later.

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

Processing your reply...

About This Blog

Detailing the aspects of Windows Presentation Foundation that goes beyond the documentation, with real world experience.