0

Is there any way in C# to get the documents sent to the printer from another program and use those documents again for something else?

I want to build an application which can get invoice sent to the printer by some point of sale system and gives opportunity to send that invoice to customer's email.

TaW
  • 53,122
  • 8
  • 69
  • 111
Zohaib Aslam
  • 336
  • 3
  • 13
  • It should be noted that documents sent to the printer are in "printer language", usually not displayable. It's not like you send PDF to a printer (which you can not do directly). – Thorsten Dittmar Aug 14 '15 at 11:33
  • possible duplicate of [How to find file location which has been queued for printing](http://stackoverflow.com/questions/12842556/how-to-find-file-location-which-has-been-queued-for-printing) – Artem Kulikov Aug 14 '15 at 11:37

1 Answers1

0

Well, you could print to the XPS printer and have it create a file. Then, let the system print the XPS file using the standard application. This may or may not work depending on some factors:

  1. Is there XPS support on the system?
  2. Did the user change the default application that handles XPS files? Maybe printing is no longer possible...
  3. Is XPS a file format you want to send to the users?
  4. etc.

That said, of course you could do the same thing with PDF, but you'd have to have access to an application that can actually print PDF. It has been asked multiple times here how to "send PDF bytes" to a printer - you can't. There are solutions, but in the end you have to answer this question for yourself:

Is it really worth the hassle or isn't it just easier to print the document and then create it again as PDF (for examples) to send to the user?

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139