3

I get the queue from my targeted printer and goes through the list of jobs on it. When a job is not IsSpooling, I try to read the JobStream to see the print job.

So far JobStream has always been null. My printed stuff comes from on DOS application and should be pure text. I've Paused the printer to safe the rain forest, but I should still be able to get the spooled data, right?

Am I missing something, or is PrintSystemJobInfo.JobStream broken?

rozon
  • 2,518
  • 4
  • 23
  • 37

1 Answers1

2

This value is almost always going to be null. Refer to this forum post: http://www.vbforums.com/showthread.php?t=549634

If you want the actual binary JobStream your best bet is to read the spool file (.SPL) out of the "C:\Windows\System32\spool\PRINTERS" directory. You can pause the job before its printed, or set the "keep print jobs" setting as mentioned in the linked forum post. Be forewarned though, this data comes in a gamut of formats all depending on the driver creating the spool file and the application initiating the print. Extracting data out of this stream is no trivial task as it will change from printer driver to printer driver. If you are working with 1 single known printer, then you may have success.

Ultratrunks
  • 2,464
  • 5
  • 28
  • 48
  • `JobStream` seems to be null even when reading a print job with Win32 API works fine (because the printer is bidirectional or because the job is in the spooler's queue not yet sent). To read it, use [`OpenPrinter("PrinterName, Job JobID")`](http://msdn.microsoft.com/en-us/library/windows/desktop/dd162751(v=vs.85).aspx), then [`ReadPrinter`](http://msdn.microsoft.com/en-us/library/windows/desktop/dd162895(v=vs.85).aspx) on that handle. – GSerg Nov 12 '14 at 18:34