Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In WPF you have many options to print. The question which one is best suited dependes IMO extremely on the content to be printed and the desired quality.</p> <p><strong>Printing visual</strong><br> If ouy want to print something that looks exactly like the representation in the UI, then you could try printing directly the visual that builds the root-content of your print-content. If you have positioning problems and have to correct properties of this visual, I would recommend to created a memory-copy of it, transform the copy and then print out this copy. Printing out visuals has IMO many drawbacks. I seldom use it except for short hacks and mini-tools. If I use, I mostly have to create the mentioned invisible copy and print out this. If you go this way, take care that you have to call Measure and <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.arrange.aspx" rel="noreferrer">Arrange</a> from code.</p> <p><strong>Printing FlowDocument</strong><br> Another possiblity is to print out a FlowDocument. If you have something that fits into <a href="http://msdn.microsoft.com/en-us/library/aa970909.aspx" rel="noreferrer">FlowDocuments</a>, I find this an easy way to create nice content to print out. Mostly if you have some simple reports, list ith some images, this way is a nice way. The print-quality is good and many complex operations will be done for you automatically as long as you don't want to override behaviour, and also this is possible. The quality of such print-out's is IMO very good. </p> <p><strong>XPS Printing</strong><br> Hovever if you have complex content and you want it to print out nicely, you have to build XPS-content and print it over the <a href="http://msdn.microsoft.com/en-us/library/ms742418.aspx#XPS_print_path_intro" rel="noreferrer">XPS Print Path</a>. This way, you have all possibilities and options, the qualitity is very good but you have the most work to do. I don't like it much, but mostly it's the way I take to print.</p> <p>I assume, that your question mainly concerns the first block, however I think it could be helpfull to see which options you have, if printing the visual is not enought (for me it's very seldom enough). Hope this answers your question. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload