1

I want to make a Windows service in c# that can change some content which is going to print.

For that i have tried to modify the .SPL file which is generated in spool folder in system32.

I have download one sample from http://www.codeproject.com/Articles/10586/EMF-Printer-Spool-File-Viewer

which convert SPL file to Image but I need text which is not possible.

How to change content before making .SPL file or any suggestion.

Example

This is original text


In print

This is duplicate text


edited as no response get

Is there any way to read directly from printer port in c# application?

Please note that i am using shared usb printer...

serial port programming is useless..

so anyone know read from usb port..

CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • You would have to intercept the data before it got to the printer, once its in the queue printers dont "hold" the job while you edit them. – BugFinder Sep 03 '12 at 13:51
  • Thanks for your reply. but i want to make general window service. If someone print from MSOffice, PDF etc than that window service will get the content and save in the database. Do u know how to do so – user1616954 Sep 03 '12 at 15:55
  • I cant see a way for you to do this the way you are trying. – BugFinder Sep 04 '12 at 06:42

1 Answers1

0

You have to write a virtual printer driver to intercept the print job and modify it before sending the final print to the actual printer.

https://www.leadtools.com/sdk/print/virtual-printer

Tony Thian
  • 79
  • 1
  • 4
  • 1
    That approach means the user can only print to your printer. OP is asking how to modify print jobs on any printer. Totally different questions. – Carey Gregory Sep 13 '17 at 05:12