6

This question

How to programmatically print to PDF file without prompting for filename in C# using the Microsoft Print To PDF printer that comes with Windows 10

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.

Community
  • 1
  • 1
Helan
  • 135
  • 2
  • 3
  • 10

1 Answers1

-1

With a WPF project, System.Drawing.Printing is where PrintDocument resides.

  • Not sure what you mean? The documentation https://msdn.microsoft.com/en-us/library/system.drawing.printing(v=vs.110).aspx describes this namespace as "The System.Drawing.Printing namespace provides print-related services for Windows Forms applications." – Helan Aug 14 '17 at 10:27
  • system.drawing.printing is not for WPF. – SHIN JaeGuk Feb 11 '19 at 06:01