Home > Microsoft .Net Development Tips > .NET Developer > Printing in Windows Presentation Foundation
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

Printing in Windows Presentation Foundation


Mark Shurmer
06.18.2008
Rating: --- (out of 5)


.NET Architecture Essentials Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


How does printing work in Windows Presentation Foundation (WPF)? We gathered some helpful excerpts and examples from the WPF Reflections blog, by Mark Shurmer below.


If you have ever worked with printing in MFC, then printing in WPF is 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.

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, and how.

What else does it give you?

You can call two different methods to do printing. PrintVisual allows you to print any class that derives from System.Windows.Medi


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
.NET Developer
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Microsoft webcast series previews new Visual Studio 2010 features
New features in Windows 7 bring new UI considerations for developers
User Account Control (UAC): How to develop code for standard users
Introduction to Vista's user account control (UAC) for developers
Visual Studio 2008 code metrics tools will help keep code clean
Downloadable MSDN library released for VS 2008 SP 1
Widgetbox provides good example of how to use Facebook Developer Toolkit

.NET Framework 3.0 design and architecture tools
WPF application speeds development, back-end integration
Designing Windows Communication Foundation service contracts
ILOG Rules for .NET integrates with Office 2007, .NET 3.0
.NET development in the trenches
Microsoft developers balancing age-old issues, barrage of new technology
SearchVB.com's Podcast Page
Visual Studio 2008 Learning Guide: Multi-targeting
Introduction to the Web Service Software Factory
Beginning Windows CardSpace development
Windows Developments: Product news, June 2007

.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
.NET 3.0  (SearchWinDevelopment.com)
IronRuby  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


a.Visual, which is a lot. And PrintDocument, which allows you to print any DocumentPaginator (e.g. FlowDocument or XpsDocument).

Troubleshooting tips

Your element, canvas, grid or other object may print out very small. I explain why this happens and demonstrate how you can use a Transform before printing to correct.

Also, when printing a multiple-page document from a FlowDocumentPageViewer or FlowDocumentReader, the pages may scale to the same size as the document being shown on the screen. Here's how to change the height and width of the document before printing.

If you enjoyed this article, be sure to visit the WPF Reflections blog for more Windows Presentation Foundation techniques.

[TABLE]
[IMAGE]

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts