Keeping a soft copy of print jobs

Posted: 01-23-2006, 11:08 AM
Hi

I'm working on a Win2000/XP security based system and one of the
requirements is that when a print job is made, a copy of whatever gets sent
to the printer should be saved on disk and an audit entry made to identify
this.
Our software already hooks certain Print API's; StartDoc, StartPage,
EndPage, EndDoc and we also have a custom print driver written using the DDK
that can manipulate the device contexts of the print jobs to add our own
text.

Does anyone have an idea how I can capture the printed job and save details?
This should work for printing from any application.

My initial thoughts are to try and mimic what happens when you select 'print
to file' when printing and then end up with a *.prn file but I don't know
how to achieve this through code.

Any advice welcomed.

Thanks

<x-posted to microsoft.public.win2000.printing>

--
KM





Reply With Quote

Responses to "Keeping a soft copy of print jobs"

Dieter
Guest
Posts: n/a
 
Re: Keeping a soft copy of print jobs
Posted: 01-24-2006, 07:39 PM
Hi Keith,

you have the following possibilities:
(sorry, i have only a german version of windows - so names will be different


1) tell the printers to keep jobs after printing:
by disabling "extended print function" the generated SPL-Files are
exactly the raw *.prn-Files you want.
When not disabled they are saved in EMF-Format in most cases.
You can simply use "EnumJobs" to get extended information about the
jobs.
2) Write a "print processor" like "genprint"-sample from DDK.
Print Processors get EMF or RAW-Files dependend on Applications,
Operating Systems and Printer Configuration.
You can duplicate RAW-Files and have all information from JOB_INFO
Problem: Your printers must use the use new "print processor" and some
drivers will use there own (hp). I don't know
if they still work when using others.
3) Write a "local monitor" like "localmon"-sample from DDK. It's a better
place to duplicate raw-Files, but
you have fewer information than in print processors.

For an example in point 1) you can download "splview" from my homepage
www.lvbprint.de.
Sorry it's only available in german language, but you can see all delivered
information about kept print jobs (Ctrl+J).

Dieter

"Keith M" <keith.mallett@nospam.amsjv.com> schrieb im Newsbeitrag
news:43d4b665_1@glkas0286.greenlnk.net...
> Hi
>
> I'm working on a Win2000/XP security based system and one of the
> requirements is that when a print job is made, a copy of whatever gets
> sent
> to the printer should be saved on disk and an audit entry made to identify
> this.
> Our software already hooks certain Print API's; StartDoc, StartPage,
> EndPage, EndDoc and we also have a custom print driver written using the
> DDK
> that can manipulate the device contexts of the print jobs to add our own
> text.
>
> Does anyone have an idea how I can capture the printed job and save
> details?
> This should work for printing from any application.
>
> My initial thoughts are to try and mimic what happens when you select
> 'print
> to file' when printing and then end up with a *.prn file but I don't know
> how to achieve this through code.
>
> Any advice welcomed.
>
> Thanks
>
> <x-posted to microsoft.public.win2000.printing>
>
> --
> KM
>
>
>
>
>

Reply With Quote
Keith M
Guest
Posts: n/a
 
Re: Keeping a soft copy of print jobs
Posted: 01-25-2006, 04:00 PM
Thanks Dieter

that has given me some ideas to think on.

We already have printprocessor that handles EMF types.
I wonder if there is a way to duplicate the EMF files from within our print
processor?

I tried your option 1 and sure enough the printer spl files stay in the
spool directory. Unfortunately the print jobs never came out of the printer
though even though they did appear in the print queue with a 'printed'
status.


"Dieter" <dieter.riekert@lvbprint.de> wrote in message
news:#77q93RIGHA.2680@TK2MSFTNGP09.phx.gbl...
> Hi Keith,
>
> you have the following possibilities:
> (sorry, i have only a german version of windows - so names will be
different
>
>
> 1) tell the printers to keep jobs after printing:
> by disabling "extended print function" the generated SPL-Files are
> exactly the raw *.prn-Files you want.
> When not disabled they are saved in EMF-Format in most cases.
> You can simply use "EnumJobs" to get extended information about the
> jobs.
> 2) Write a "print processor" like "genprint"-sample from DDK.
> Print Processors get EMF or RAW-Files dependend on Applications,
> Operating Systems and Printer Configuration.
> You can duplicate RAW-Files and have all information from JOB_INFO
> Problem: Your printers must use the use new "print processor" and
some
> drivers will use there own (hp). I don't know
> if they still work when using others.
> 3) Write a "local monitor" like "localmon"-sample from DDK. It's a better
> place to duplicate raw-Files, but
> you have fewer information than in print processors.

Reply With Quote
Dieter
Guest
Posts: n/a
 
Re: Keeping a soft copy of print jobs
Posted: 01-26-2006, 08:39 PM
Hi Keith,

if you find out the name of the SPL-File you can use the functions:

AddJob () //returns name of a spl-File to copy your file to
RevertToPrinterSelf (); // get system-rights
copy files
ImpersonatePrinterClient ();
ScheduleJob ()

to schedule the job to another printer.
Spooler must be configured to start when last side is spooled.

An other posibility is to examine the SPL-File, which consist of
multiple EMF-Pages, and play each page to another device. You have to
extract embedded fonts
(clients embed them, when fonts are not present on print servers).

2000/XP print processors could have other possibities to.
I think it's possible to read the spool-file by ReadPrinter with
printer opened in a special way ("<PrinterName>,job")


Some hints to get the name of the spl-File:

Under XP spool-jobs are named "fp*.spl". You advise XP
to generate SPL-Files in old style names ("%05d", jobid) by keeping
print files or by setting a per printer spool directory in the registry
<HKLM>\System\CurrentControlSet\Control\Print\Prin ters\<Your
Printer>\SpoolDirectory.

Dieter


"Keith M" <keith.mallett@nospam.amsjv.com> schrieb im Newsbeitrag
news:43d79db7$1_1@glkas0286.greenlnk.net...
> Thanks Dieter
>
> that has given me some ideas to think on.
>
> We already have printprocessor that handles EMF types.
> I wonder if there is a way to duplicate the EMF files from within our
> print
> processor?
>
> I tried your option 1 and sure enough the printer spl files stay in the
> spool directory. Unfortunately the print jobs never came out of the
> printer
> though even though they did appear in the print queue with a 'printed'
> status.
>
>
> "Dieter" <dieter.riekert@lvbprint.de> wrote in message
> news:#77q93RIGHA.2680@TK2MSFTNGP09.phx.gbl...
>> Hi Keith,
>>
>> you have the following possibilities:
>> (sorry, i have only a german version of windows - so names will be
> different
>>
>>
>> 1) tell the printers to keep jobs after printing:
>> by disabling "extended print function" the generated SPL-Files are
>> exactly the raw *.prn-Files you want.
>> When not disabled they are saved in EMF-Format in most cases.
>> You can simply use "EnumJobs" to get extended information about the
>> jobs.
>> 2) Write a "print processor" like "genprint"-sample from DDK.
>> Print Processors get EMF or RAW-Files dependend on Applications,
>> Operating Systems and Printer Configuration.
>> You can duplicate RAW-Files and have all information from JOB_INFO
>> Problem: Your printers must use the use new "print processor" and
> some
>> drivers will use there own (hp). I don't know
>> if they still work when using others.
>> 3) Write a "local monitor" like "localmon"-sample from DDK. It's a better
>> place to duplicate raw-Files, but
>> you have fewer information than in print processors.
>
>


Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping a copy of message on mail server Mary Johnson Windows Vista Mail 2 08-18-2007 08:44 PM
Print Jobs Hang, don't print Sherry Windows XP Printers / Scanners / Fax 0 08-01-2004 09:57 PM
print spooler deleting print jobs Alan Morris\(MSFT\) Windows XP Printers / Scanners / Fax 0 09-29-2003 09:12 PM
cannot delete print jobs from print queue Raj Windows XP Printers / Scanners / Fax 0 09-19-2003 10:46 AM
Old print jobs stays on print queue on XP ayex Windows XP Printers / Scanners / Fax 1 07-09-2003 08:42 PM