-2

I want to know that, is there any way to access the file that is going to print. Suppose i have a software that has a print button. If i click the print button it will call the printer to print. Can i get the file from printer driver or from any other source during these process.

Regards Ansif

Ansif
  • 182
  • 2
  • 14
  • Perhaps [this](http://stackoverflow.com/questions/1019036/how-to-create-a-virtual-printer-in-windows) might help somewhat. – chris Jan 07 '13 at 03:23

1 Answers1

1

Programs don't send "files" to a printer. In the case of PostScript and PCL printers, programs send commands to the printer, such as "draw text "foobar" at point (10,23)".

Modern (especially cheaper) printers in the past 17 years or so, are often GDI printers, where programs use Windows' GDI functions to "draw" the printed page to a raster buffer which is then sent to the printer, which makes the printers cheaper as they don't need a command interpreter and processor built-in.

So to answer your question, "no", you cannot access files that are going to print, because they don't exist.

Dai
  • 141,631
  • 28
  • 261
  • 374
  • Thank you for your valuable information. Is there any API to access these commands. For example, get all characters in a buffer string. – Ansif Jan 10 '13 at 08:15
  • No, there isn't. Your question sounds like an "XY Problem". Please tell us why you want to intercept printer output. – Dai Jan 11 '13 at 22:14