Results 1 to 4 of 4

Thread: Monitoring / Capturing a Print Job

  1. #1

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Monitoring / Capturing a Print Job

    I am looking to write a process that will get the spool data from any print job sent to a particular printer, so I can take it and pass it through to another application.

    I see that Merrion has a project up on codeplex that helps with printer monitoring, so that may be a start, but I can't quite figure out how to get at the spool data.

    If I understand printing correctly, the spool data should be in EMF format, which is fine by me.

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Monitoring / Capturing a Print Job

    When a print job is sent to a printer, it will go to the spool folder (by default it's $windows$\System32\spool\ directory) as a file and get deleted after the print job is done. So I guess you can use a filesystemwatcher to watch that spool folder any new file and perform desired actions from there.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Monitoring / Capturing a Print Job

    ...here be dragons...

    OK - spool files are in two possible formats : EMF or RAW...

    Where raw means in the printer control language used by the printer. This might be PostScript or PCL 5 or PCL 6 or PJL...

    In Windows 95 and below a spool file is an unholly mess of .tmp files - ignore these operating systems for the sake of your sanity.

    In the NT3.5 family and its many offspring (XP, 2000 etc.) the spool file is actually two files per print job. A spool shadow file that has the print job details (i.e. what is reported to the spool window) and the spool file (*.spl) that has the actual print job in it.

  4. #4

    Thread Starter
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Monitoring / Capturing a Print Job

    I think I get the whole EMF / RAW printing formats, as I have been testing many printing scenarios over the last few weeks.

    My real question is, is there an event I can trap that will give me the spool filename (provided the printer is setup for spooling) and let me process that file prior to Windows deleting it?

    Do I have to programatically pause the printer, get the file, then unpause the printer?

    I can't really go with Stanav's approach, because I only want the print job from a single printer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width