This question
contains a good answer on how to achieve this in a Windows Forms application.
Unfortunately I use WPF and have not been able to find a working solution. WPF contains the classes PrintTicket and PrintQueue to control the output, but neither of them contain a PrintToFile (or similar) property.