Best method to print using wpf 4
- by user293545
Howdy,
I need to be able to print from my wpf application. I am just trying to print a transaction receipt.
I have found that using
PrintDialog pDialog = new PrintDialog();
pDialog.PrintVisual(new Receipt("transaction name","my store"), "documentTitle");
Does the trick very nicely. "Receipt() is a usercontrol that renders out the transaction details.
How are you meant to do this? is this the correct way? what do I do if I dont know the printer that is going to be used? should I make the usercontrol only as wide as a thermal receipt printer?
Any suggestions would be great!