|
-
Aug 8th, 2008, 01:14 PM
#1
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.
-
Aug 8th, 2008, 01:52 PM
#2
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 -
-
Aug 8th, 2008, 03:38 PM
#3
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.
-
Aug 8th, 2008, 03:44 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|