1

I am trying to use the printspoolerapi to take a print job and reroute it to another printer. So far I believe i have captured the information required through enumjobs, but when setting the print job to another printer I get an empty sheet printed out.

So obviously I am not sending along the file or it's contents, just the data type and print job name.

As far as I can tell I need to get the file and send it to the WritePrint? I believe either the .spl file or the actual file itself should be used for this. (using AddJob for getting the actual file, if I can do that)

Specifically, has anyone successfully done this before? I need to see an example or something like that. I've looked all over and haven't really found something that gives me an example on this.

ashmont
  • 25
  • 10
  • Can you install a custom print processor in the printer you're targeting? – MrEricSir May 10 '17 at 23:04
  • Print device or printer? If print device, then no – ashmont May 10 '17 at 23:06
  • @MrEricSir I think I can, can you elaborate on that solution? – ashmont May 11 '17 at 00:53
  • Also I'm not targeting one printer in specific, could be many at once. – ashmont May 11 '17 at 01:02
  • The trouble with trying to enumerate jobs and then redirect them to another printer is that by the time you find it and change it, it will usually already have begun printing. You have to intercept it before that happens. With small print jobs that's going to be a challenge. – Carey Gregory May 14 '17 at 22:54
  • I can think of several ways to do this, but they all involve altering existing printers to use an alternate print processor or port monitor. Is that allowable? – Carey Gregory May 14 '17 at 22:56
  • I was sending them to a non existent printer, so they would stop by default. You are correct though. – ashmont May 14 '17 at 22:56

1 Answers1

0

RedMon might be useful if you can change the port. (Or at least the source code might inspire you.)

Nick Westgate
  • 3,088
  • 2
  • 34
  • 41