Tech Support > Microsoft Windows > Drivers > Printer driver document events
Printer driver document events
Posted by Luminita on June 23rd, 2005


Hi

I am developing a virtual printer driver starting from the MSPLOT DDK sample.

What I need to do is:
- when the printing starts, show a dialog box so the user can choose a file
name
- render the print job to the selected file
- when the print job is finished, open the generated file and show the
result to the user

I show the first dialog box in the DrvDocumentEvent, STARTDOCPOST event, and
I pass the file name to the renderer dll in the JOB_INFO_2 structure. That
works fine, I can read the job information in the renderer dll and generate
the printing file.

The problem is that when the job is finished, how can I open the generated
file from the context of the user that started the print job? The logic
option would be DrvDocumentEvent, ENDDOC or ENDDOCPOST events, but these
events don't come at all (the spool is enabled). And even if they would come,
they do not have a parameter for the job id, so I cannot retrieve the file
name.

Where should I implement this tasks on the end print job?

Thanks,
Luminita

Posted by Debabrata Sarma[MSFT] on June 24th, 2005


It will not be possible to open the file from the context of the user.
If a background application or a service is already running in the user's
context, it may be possible to send message to that application.

The document for the DrvDocumentEvent, function states the following, if
this is of any help.

"When EMF spooling is disabled, the function can display a user interface.
For example,
the DrvDocumentEvent function for a FAX driver might display a dialog box
to the user
before GDI's StartDoc function (described in the Platform SDK
documentation) is processed."

Thanks.

Deba Sarma
MICROSOFT DDK Print Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.


Similar Posts