Question regarding Rendering Plug In for Printer Driver

For each printjob fired I have to save the printed data in the form of a bitmap,
I understand that for this purpose I need to write a rendering plug-in. I have seen the DDK example for bitmap driver. But it is installed as a separate printer.
THE SCENARIO THAT I WANT TO CREATE IS:
I shall write a rendering plugin which will collect the bitmap data in the ImageProcessing function, and then save it as a bmp file in the DrvEndDoc function.
The rendering plugin dll is to be placed in the already existing printer driver stack, so that it can be used by the installed printer, and for any print job fired for that printer, the bitmap file of the data printed is created along withe printouts. Is this thing possible? If yes then how?

Thanks & regards
Pankaj


Yahoo! India Answers: Share what you know. Learn something new Click here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here

It might be possible. I know that this method (or something very
similar) works for monolithic drivers. I am just guessing that it would
work for a plugin.

First, you would rename the original drivers rendering dll to something
like “OriginalRenderingDLL.DLL”. Then you would copy your rendering dll
into the printer driver directory, giving it the name of the original
drivers rendering dll. By doing this, you have replaced the rendering
DLL of the original driver with one of your own.

In your rendering dll, in the IPrintOemUni::EnableDriver method, you
would load the original dll and call it’s EnableDriver method. You
would save it’s DRVENABLEDATA structure. You would return a
DRVENABLEDATA structure which has all of YOUR required entry points
enabled, as well as every entry point the original drivers rendering dll
enabled.

Your rendering dll would have to implement every possible DDI function,
and all methods of IPrintOemUni/IPrintOemUni2. In each one, you would
do what you want to do (which might be nothing), then call the original
dlls implementation. For something in a DRVENABLEDATA structure, it’s
just calling thru a pointer. I’m not sure how you would do
IPrintOemUni* methods, or if it’s even possible.

Also, you might need to load the original dll somewhere other than
enabledriver, I’m not sure.

[This idea is not original with me, I learned it at the Paul Yao printer
drivers course.]

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pankaj Adlakha
Sent: Thursday, July 06, 2006 8:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question regarding Rendering Plug In for Printer Driver

For each printjob fired I have to save the printed data in the form of a
bitmap,
I understand that for this purpose I need to write a rendering plug-in.
I have seen the DDK example for bitmap driver. But it is installed as a
separate printer.
THE SCENARIO THAT I WANT TO CREATE IS:
I shall write a rendering plugin which will collect the bitmap data in
the ImageProcessing function, and then save it as a bmp file in the
DrvEndDoc function.
The rendering plugin dll is to be placed in the already existing printer
driver stack, so that it can be used by the installed printer, and for
any print job fired for that printer, the bitmap file of the data
printed is created along withe printouts. Is this thing possible? If yes
then how?

Thanks & regards
Pankaj

Yahoo! India Answers: Share what you know. Learn something new Click
here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi Scott

Thanks a lot for your reply…
I am analyzing it…and will soon write if I face problems.

I have one more question…
In the DDK there is info regarding customization for printer models which
are either Unidrv or Pscript driver based.(using the rendering and interface plugin concept).
What do we do, in the case of printers, which have a proprietary driver (for example the HP LaserJet 1022 model, which has a driver IMFNT5.dll, and doesn’t have an .ini file which can specify about the rendering plugin.). How can the customization be done in this case (like in my case i want the bitmap to be saved, for each printout).
Please enlighten me.

Thanks & regards
Pankaj

“Robins, Scott” wrote:
It might be possible. I know that this method (or something very
similar) works for monolithic drivers. I am just guessing that it would
work for a plugin.

First, you would rename the original drivers rendering dll to something
like “OriginalRenderingDLL.DLL”. Then you would copy your rendering dll
into the printer driver directory, giving it the name of the original
drivers rendering dll. By doing this, you have replaced the rendering
DLL of the original driver with one of your own.

In your rendering dll, in the IPrintOemUni::EnableDriver method, you
would load the original dll and call it’s EnableDriver method. You
would save it’s DRVENABLEDATA structure. You would return a
DRVENABLEDATA structure which has all of YOUR required entry points
enabled, as well as every entry point the original drivers rendering dll
enabled.

Your rendering dll would have to implement every possible DDI function,
and all methods of IPrintOemUni/IPrintOemUni2. In each one, you would
do what you want to do (which might be nothing), then call the original
dlls implementation. For something in a DRVENABLEDATA structure, it’s
just calling thru a pointer. I’m not sure how you would do
IPrintOemUni* methods, or if it’s even possible.

Also, you might need to load the original dll somewhere other than
enabledriver, I’m not sure.

[This idea is not original with me, I learned it at the Paul Yao printer
drivers course.]

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pankaj Adlakha
Sent: Thursday, July 06, 2006 8:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question regarding Rendering Plug In for Printer Driver

For each printjob fired I have to save the printed data in the form of a
bitmap,
I understand that for this purpose I need to write a rendering plug-in.
I have seen the DDK example for bitmap driver. But it is installed as a
separate printer.
THE SCENARIO THAT I WANT TO CREATE IS:
I shall write a rendering plugin which will collect the bitmap data in
the ImageProcessing function, and then save it as a bmp file in the
DrvEndDoc function.
The rendering plugin dll is to be placed in the already existing printer
driver stack, so that it can be used by the installed printer, and for
any print job fired for that printer, the bitmap file of the data
printed is created along withe printouts. Is this thing possible? If yes
then how?

Thanks & regards
Pankaj

Yahoo! India Answers: Share what you know. Learn something new Click
here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

---------------------------------
Find out what India is talking about on Yahoo! Answers India.
So, what’s NEW about the NEW Yahoo! Messenger? Find out.

As I said in the original reply, I know this method works for monolithic
(what you refer to as proprietary) drivers. I don’t know if it works
for unidrv/ps plugins, but I *assume* it will.

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pankaj Adlakha
Sent: Tuesday, July 11, 2006 1:23 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding Rendering Plug In for
Printer Driver

Hi Scott

Thanks a lot for your reply…
I am analyzing it…and will soon write if I face problems.

I have one more question…
In the DDK there is info regarding customization for printer
models which
are either Unidrv or Pscript driver based.(using the rendering
and interface plugin concept).
What do we do, in the case of printers, which have a proprietary
driver (for example the HP LaserJet 1022 model, which has a driver
IMFNT5.dll, and doesn’t have an .ini file which can specify about the
rendering plugin.). How can the customization be done in this case (like
in my case i want the bitmap to be saved, for each printout).
Please enlighten me.

Thanks & regards
Pankaj

“Robins, Scott” wrote:

It might be possible. I know that this method (or
something very
similar) works for monolithic drivers. I am just
guessing that it would
work for a plugin.

First, you would rename the original drivers rendering
dll to something
like “OriginalRenderingDLL.DLL”. Then you would copy
your rendering dll
into the printer driver directory, giving it the name of
the original
drivers rendering dll. By doing this, you have replaced
the rendering
DLL of the original driver with one of your own.

In your rendering dll, in the IPrintOemUni::EnableDriver
method, you
would load the original dll and call it’s EnableDriver
method. You
would save it’s DRVENABLEDATA structure. You would
return a
DRVENABLEDATA structure which has all of YOUR required
entry points
enabled, as well as every entry point the original
drivers rendering dll
enabled.

Your rendering dll would have to implement every
possible DDI function,
and all methods of IPrintOemUni/IPrintOemUni2. In each
one, you would
do what you want to do (which might be nothing), then
call the original
dlls implementation. For something in a DRVENABLEDATA
structure, it’s
just calling thru a pointer. I’m not sure how you would
do
IPrintOemUni* methods, or if it’s even possible.

Also, you might need to load the original dll somewhere
other than
enabledriver, I’m not sure.

[This idea is not original with me, I learned it at the
Paul Yao printer
drivers course.]

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Pankaj Adlakha
Sent: Thursday, July 06, 2006 8:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question regarding Rendering Plug In
for Printer Driver

For each printjob fired I have to save the printed data
in the form of a
bitmap,
I understand that for this purpose I need to write a
rendering plug-in.
I have seen the DDK example for bitmap driver. But it is
installed as a
separate printer.
THE SCENARIO THAT I WANT TO CREATE IS:
I shall write a rendering plugin which will collect the
bitmap data in
the ImageProcessing function, and then save it as a bmp
file in the
DrvEndDoc function.
The rendering plugin dll is to be placed in the already
existing printer
driver stack, so that it can be used by the installed
printer, and for
any print job fired for that printer, the bitmap file of
the data
printed is created along withe printouts. Is this thing
possible? If yes
then how?

Thanks & regards
Pankaj

Yahoo! India Answers: Share what you know. Learn
something new Click
here
Catch all the FIFA World Cup 2006 action on Yahoo! India
Click here —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To
unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR
Online at http://www.osronline.com/page.cfm?name=ListServer

________________________________

Find out what India is talking about on Yahoo! Answers India.
http:o.com/>
So, what’s NEW about the NEW Yahoo! Messenger? Find out.
http:yahoo.com/> — Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:></http:>