RE: Virtual Printer Driver -> RAW = (PCL | PS | CAPSL) ?

I might have misunderstood what you want to accomplish.

What do you mean by “RAW” data? Do you want the data as GDI/EMF, the
printers own mark-up language like PCL or PS, or do you want the data as
bitmap image data?

Regards,
Christoph

-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 6:25 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver

Hi Christoph,

Thanks for the information and link. Im trying to capture the raw data. Can
you tell me is this only possible by extracting the EMF file or can we
caputure the data by writing a rendering plug-in. Any suggestions would help
me?

Thanks & Regards,
Sush

Christoph Lindemann wrote:

Hi Sush,

Extracting EMF data is not supported by Windows/Microsoft. If you want to do
it anyway, you can find informations on how to do this at
http://undocprint.printassociates.com/
http:</http:> Here you can also find a link to a
open source project.

Regards,
Christoph Lindemann

-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 2:32 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Printer Driver

Hello All,

A very happy new year to all of you.

I am developing a virtual printer driver. i used ddk provided sample gpd
files to generate my minidriver. i want to capture the raw data instead of
EMF data and send it to file rather than printer port. I used a rendering
plug-in sample (src/print/oemdll/oemuni) and tried to modify accordingly. i
changed the inf file and included the plug-in dll and installed the drivers.
I tried to trace out by including some debugging messages, but i dint find
my dllentry being called. Do i need to tell my mini driver to include and
load the rendering plug-in also.

Can any one help me out to solve this problem?

Do i really need to implement a rendering plug-in?

Is there any sample available to capture the raw data?

Thanks & Regards,
Sush



Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search. Learn
http:
more. — Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed to
ntdev as: xxxxx@printassociates.com To unsubscribe send a
blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com



Do you Yahoo!?
Send holiday email and support a worthy cause. Do
http:</http:> good.
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed to
ntdev as: xxxxx@printassociates.com To unsubscribe send a
blank email to xxxxx@lists.osr.com</http:>

Thanks chirstoph and aswin for your replies. I need the data as a bitmap image. By your comments i understood that i need to do this in a custom print processor. Is this the correct component to be implemented? Any Suggestions?

Chistoph, I have one more query. How do i capture the following format.

GDI/EMF — Which component should i implement?
PCL/PS ---- Which component should i implement?
Bitmap Image — Which component should i implement?

Thanks & Regards,
Sush

Christoph Lindemann wrote:
I might have misunderstood what you want to accomplish.

What do you mean by “RAW” data? Do you want the data as GDI/EMF, the printers own mark-up language like PCL or PS, or do you want the data as bitmap image data?

Regards,
Christoph
-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 6:25 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver

Hi Christoph,

Thanks for the information and link. Im trying to capture the raw data. Can you tell me is this only possible by extracting the EMF file or can we caputure the data by writing a rendering plug-in. Any suggestions would help me?

Thanks & Regards,
Sush

Christoph Lindemann wrote:
Hi Sush,

Extracting EMF data is not supported by Windows/Microsoft. If you want to do it anyway, you can find informations on how to do this at http://undocprint.printassociates.com/ Here you can also find a link to a open source project.

Regards,
Christoph Lindemann
-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 2:32 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Printer Driver

Hello All,

A very happy new year to all of you.

I am developing a virtual printer driver. i used ddk provided sample gpd files to generate my minidriver. i want to capture the raw data instead of EMF data and send it to file rather than printer port. I used a rendering plug-in sample (src/print/oemdll/oemuni) and tried to modify accordingly. i changed the inf file and included the plug-in dll and installed the drivers. I tried to trace out by including some debugging messages, but i dint find my dllentry being called. Do i need to tell my mini driver to include and load the rendering plug-in also.

Can any one help me out to solve this problem?

Do i really need to implement a rendering plug-in?

Is there any sample available to capture the raw data?

Thanks & Regards,
Sush

---------------------------------
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search. Learn more. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@printassociates.com To unsubscribe send a blank email to xxxxx@lists.osr.com—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do you Yahoo!?
Send holiday email and support a worthy cause. Do good. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@printassociates.com To unsubscribe send a blank email to xxxxx@lists.osr.com—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! – Try it today!

No…you should write a rendering plug-in and follow the approach I
outlined in my previous reply.

Regarding your other question:

GDI/EMF — Which component should i implement?
Answer: EMF is the spool file format…so if all you need is a bitmap
image, I don’t see why you need to capture EMF. Also, note that for any
given job, there is no guarantee that EMF is the format used for
spooling…it could be RAW as well.

PCL/PS ---- Which component should i implement?
Answer: Rendering plug-in…for PCL it needs to be a Unidrv based
rendering plug-in and for PS it needs to be a Pscript based plug-in.

Bitmap Image — Which component should i implement?
Answer: Rendering plug-in with ImageProcessing and the approach outlined
in my previous reply.

  • Ashwin

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sushma Yella
Sent: Tuesday, January 04, 2005 10:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL | PS | CAPSL)
?

Thanks chirstoph and aswin for your replies. I need the data as a bitmap
image. By your comments i understood that i need to do this in a custom
print processor. Is this the correct component to be implemented? Any
Suggestions?

Chistoph, I have one more query. How do i capture the following format.

GDI/EMF — Which component should i implement?
PCL/PS ---- Which component should i implement?
Bitmap Image — Which component should i implement?

Thanks & Regards,
Sush

Christoph Lindemann wrote:

I might have misunderstood what you want to accomplish.

What do you mean by “RAW” data? Do you want the data as GDI/EMF,
the printers own mark-up language like PCL or PS, or do you want the
data as bitmap image data?

Regards,
Christoph

-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 6:25 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver

Hi Christoph,

Thanks for the information and link. Im trying to
capture the raw data. Can you tell me is this only possible by
extracting the EMF file or can we caputure the data by writing a
rendering plug-in. Any suggestions would help me?

Thanks & Regards,
Sush

Christoph Lindemann
wrote:

Hi Sush,

Extracting EMF data is not supported by
Windows/Microsoft. If you want to do it anyway, you can find
informations on how to do this at http://undocprint.printassociates.com/
Here you can also find a link to a open source project.

Regards,
Christoph Lindemann

-----Original Message-----
From: Sushma Yella
[mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 2:32 PM
To: Windows System Software Devs
Interest List
Subject: [ntdev] Virtual Printer Driver

Hello All,

A very happy new year to all of you.

I am developing a virtual printer
driver. i used ddk provided sample gpd files to generate my minidriver.
i want to capture the raw data instead of EMF data and send it to file
rather than printer port. I used a rendering plug-in sample
(src/print/oemdll/oemuni) and tried to modify accordingly. i changed the
inf file and included the plug-in dll and installed the drivers. I tried
to trace out by including some debugging messages, but i dint find my
dllentry being called. Do i need to tell my mini driver to include and
load the rendering plug-in also.

Can any one help me out to solve this
problem?

Do i really need to implement a
rendering plug-in?

Is there any sample available to capture
the raw data?

Thanks & Regards,
Sush



Do you Yahoo!?
Yahoo! Mail - Find what you need with
new enhanced search. Learn more.
http:
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@printassociates.com To unsubscribe send
a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as:
xxxxx@yahoo.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com



Do you Yahoo!?
Send holiday email and support a worthy cause. Do good.
http:</http:>
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@printassociates.com To unsubscribe send
a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@yahoo.com

To unsubscribe send a blank email to
xxxxx@lists.osr.com

________________________________

Do you Yahoo!?
Meet the all-new My Yahoo! http: - Try it today! —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com</http:></http:>

Hello Ashwin,

I used the sample rendering plug-in provided by ddk. i followed the steps to create a bitmap with the data. The bitmap file is created but without any data. My ImageProcessing function is called only once for any file size that i give for printing. My ImageProcessing function looks like this. Can you comment if i need to change anything.

HRESULT __stdcall IOemUni::ImageProcessing(
PDEVOBJ pdevobj,
PBYTE pSrcBitmap,
PBITMAPINFOHEADER pBitmapInfoHeader,
PBYTE pColorTable,
DWORD dwCallbackID,
PIPPARAMS pIPParams,
OUT PBYTE *ppbResult)
{

RECT Rect;
Rect.left =Rect.top =0;
Rect.bottom = 600;
Rect.right = 800;

HDC compDC = CreateCompatibleDC(NULL);
RECT RectRes;
RectRes.left =RectRes.top =0;
RectRes.bottom= (GetDeviceCaps(compDC , LOGPIXELSY) *
Rect.bottom * 10 )/(254);
RectRes.right = (GetDeviceCaps(compDC, LOGPIXELSX) *
Rect.right * 10) /254;

BITMAPINFO bmi;
BITMAPINFOHEADER *bmih = (BITMAPINFOHEADER *)&bmi;
LPBYTE pBits;

bmih->biSize = sizeof (BITMAPINFOHEADER) ;
bmih->biWidth = RectRes.right;
bmih->biHeight = RectRes.bottom;
bmih->biPlanes = 1 ;
bmih->biBitCount = 24 ;
bmih->biCompression = BI_RGB ;
bmih->biSizeImage = (((RectRes.right * 24 + 31) & ~31)/8)
* RectRes.bottom ;
bmih->biXPelsPerMeter = 0 ;
bmih->biYPelsPerMeter = 0 ;
bmih->biClrUsed = 0 ;
bmih->biClrImportant = 0 ;
HBITMAP hbm = CreateDIBSection (compDC, (BITMAPINFO *) &bmi, 0, (void **)&pBits, NULL, 0) ;

SelectObject(compDC , hbm);
PatBlt(compDC , 0,0,bmih->biWidth , bmih->biHeight , WHITENESS);

BITMAPFILEHEADER hdr;
HANDLE hf = CreateFile(_T(“t1.bmp”),
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);

hdr.bfType = 0x4d42;

// Compute the size of the entire file.
hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof(RGBQUAD) + bmih->biSizeImage);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;

// Compute the offset to the array of color indices.
hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof (RGBQUAD);

DWORD dwTmp;
// Copy the BITMAPFILEHEADER into the .BMP file.
WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), (LPDWORD) &dwTmp, NULL);

WriteFile(hf, (LPVOID) bmih, sizeof(BITMAPINFOHEADER) + bmih->biClrUsed * sizeof (RGBQUAD),
(LPDWORD) &dwTmp, ( NULL));
DWORD cb = bmih->biSizeImage;
WriteFile(hf, (LPSTR)pBits, (int) cb, (LPDWORD) &dwTmp,NULL);
CloseHandle(hf);
DeleteDC(compDC);
DeleteObject(hbm);
}

Thanks & Regards,

Sush

Ashwin Needamangala wrote:
No…you should write a rendering plug-in and follow the approach I
outlined in my previous reply.

Regarding your other question:

GDI/EMF — Which component should i implement?
Answer: EMF is the spool file format…so if all you need is a bitmap
image, I don’t see why you need to capture EMF. Also, note that for any
given job, there is no guarantee that EMF is the format used for
spooling…it could be RAW as well.

PCL/PS ---- Which component should i implement?
Answer: Rendering plug-in…for PCL it needs to be a Unidrv based
rendering plug-in and for PS it needs to be a Pscript based plug-in.

Bitmap Image — Which component should i implement?
Answer: Rendering plug-in with ImageProcessing and the approach outlined
in my previous reply.

- Ashwin



From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sushma Yella
Sent: Tuesday, January 04, 2005 10:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL | PS | CAPSL)
?

Thanks chirstoph and aswin for your replies. I need the data as a bitmap
image. By your comments i understood that i need to do this in a custom
print processor. Is this the correct component to be implemented? Any
Suggestions?

Chistoph, I have one more query. How do i capture the following format.

GDI/EMF — Which component should i implement?
PCL/PS ---- Which component should i implement?
Bitmap Image — Which component should i implement?

Thanks & Regards,
Sush

Christoph Lindemann wrote:

I might have misunderstood what you want to accomplish.

What do you mean by “RAW” data? Do you want the data as GDI/EMF,
the printers own mark-up language like PCL or PS, or do you want the
data as bitmap image data?

Regards,
Christoph

-----Original Message-----
From: Sushma Yella [mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 6:25 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver

Hi Christoph,

Thanks for the information and link. Im trying to
capture the raw data. Can you tell me is this only possible by
extracting the EMF file or can we caputure the data by writing a
rendering plug-in. Any suggestions would help me?

Thanks & Regards,
Sush

Christoph Lindemann
wrote:

Hi Sush,

Extracting EMF data is not supported by
Windows/Microsoft. If you want to do it anyway, you can find
informations on how to do this at http://undocprint.printassociates.com/
Here you can also find a link to a open source project.

Regards,
Christoph Lindemann

-----Original Message-----
From: Sushma Yella
[mailto:xxxxx@yahoo.com]
Sent: Monday, January 03, 2005 2:32 PM
To: Windows System Software Devs
Interest List
Subject: [ntdev] Virtual Printer Driver

Hello All,

A very happy new year to all of you.

I am developing a virtual printer
driver. i used ddk provided sample gpd files to generate my minidriver.
i want to capture the raw data instead of EMF data and send it to file
rather than printer port. I used a rendering plug-in sample
(src/print/oemdll/oemuni) and tried to modify accordingly. i changed the
inf file and included the plug-in dll and installed the drivers. I tried
to trace out by including some debugging messages, but i dint find my
dllentry being called. Do i need to tell my mini driver to include and
load the rendering plug-in also.

Can any one help me out to solve this
problem?

Do i really need to implement a
rendering plug-in?

Is there any sample available to capture
the raw data?

Thanks & Regards,
Sush



Do you Yahoo!?
Yahoo! Mail - Find what you need with
new enhanced search. Learn more.

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@printassociates.com To unsubscribe send
a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as:
xxxxx@yahoo.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com



Do you Yahoo!?
Send holiday email and support a worthy cause. Do good.

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@printassociates.com To unsubscribe send
a blank email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@yahoo.com

To unsubscribe send a blank email to
xxxxx@lists.osr.com



Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today! —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed
to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank
email to xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

I’ve never dealt with printer drivers, but surely you need to do SOMETHING
with teh original bitmap that came into the ImageProcessing call? By that,
I mean the pSrcBitmap and pBitmapInfoHeader. As far as I can see, all you
do is fill your local bitmap with white, and then write it to a file. I
would expect this to become a white bitmap in the file. You may want to
also bitblt the incoming bitmap into your local bitmap, and you may be able
to see something more useful.

But I may have missed something here…


Mats

-------- Notice --------
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or any
action taken by you in reliance on it, is prohibited and may be unlawful.
If you have received this message in error, please delete it and contact
the sender immediately. Thank you.

xxxxx@lists.osr.com wrote on 01/05/2005 02:03:14 PM:

Hello Ashwin,

I used the sample rendering plug-in provided by ddk. i followed the
steps to create a bitmap with the data. The bitmap file is created
but without any data. My ImageProcessing function is called only
once for any file size that i give for printing. My ImageProcessing
function looks like this. Can you comment if i need to change anything.

HRESULT __stdcall IOemUni::ImageProcessing(
PDEVOBJ pdevobj,
PBYTE pSrcBitmap,
PBITMAPINFOHEADER pBitmapInfoHeader,
PBYTE pColorTable,
DWORD dwCallbackID,
PIPPARAMS pIPParams,
OUT PBYTE *ppbResult)
{
RECT Rect;
Rect.left =Rect.top =0;
Rect.bottom = 600;
Rect.right = 800;
HDC compDC = CreateCompatibleDC(NULL);
RECT RectRes;
RectRes.left =RectRes.top =0;
RectRes.bottom= (GetDeviceCaps(compDC , LOGPIXELSY) *
Rect.bottom * 10 )/(254);
RectRes.right = (GetDeviceCaps(compDC, LOGPIXELSX) *
Rect.right * 10) /254;
BITMAPINFO bmi;
BITMAPINFOHEADER *bmih = (BITMAPINFOHEADER *)&bmi;
LPBYTE pBits;
bmih->biSize = sizeof (BITMAPINFOHEADER) ;
bmih->biWidth = RectRes.right;
bmih->biHeight = RectRes.bottom;
bmih->biPlanes = 1 ;
bmih->biBitCount = 24 ;
bmih->biCompression = BI_RGB ;
bmih->biSizeImage = (((RectRes.right * 24 + 31) & ~31)/8)
* RectRes.bottom ;
bmih->biXPelsPerMeter = 0 ;
bmih->biYPelsPerMeter = 0 ;
bmih->biClrUsed = 0 ;
bmih->biClrImportant = 0 ;
HBITMAP hbm = CreateDIBSection (compDC, (BITMAPINFO *) &bmi, 0,
(void **)&pBits, NULL, 0) ;
SelectObject(compDC , hbm);
PatBlt(compDC , 0,0,bmih->biWidth , bmih->biHeight , WHITENESS);

BITMAPFILEHEADER hdr;
HANDLE hf = CreateFile(_T(“t1.bmp”),
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
hdr.bfType = 0x4d42;
// Compute the size of the entire file.
hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof(RGBQUAD) + bmih->biSizeImage);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
// Compute the offset to the array of color indices.
hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof (RGBQUAD);
DWORD dwTmp;
// Copy the BITMAPFILEHEADER into the .BMP file.
WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), (LPDWORD)
&dwTmp, NULL);
WriteFile(hf, (LPVOID) bmih, sizeof(BITMAPINFOHEADER) +
bmih->biClrUsed * sizeof (RGBQUAD),
(LPDWORD) &dwTmp, ( NULL));
DWORD cb = bmih->biSizeImage;
WriteFile(hf, (LPSTR)pBits, (int) cb, (LPDWORD) &dwTmp,NULL);
CloseHandle(hf);
DeleteDC(compDC);
DeleteObject(hbm);
}

Thanks & Regards,
Sush

Ashwin Needamangala wrote:
> No…you should write a rendering plug-in and follow the approach I
> outlined in my previous reply.
>
> Regarding your other question:
>
> GDI/EMF — Which component should i implement?
> Answer: EMF is the spool file format…so if all you need is a bitmap
> image, I don’t see why you need to capture EMF. Also, note that for any
> given job, there is no guarantee that EMF is the format used for
> spooling…it could be RAW as well.
>
> PCL/PS ---- Which component should i implement?
> Answer: Rendering plug-in…for PCL it needs to be a Unidrv based
> rendering plug-in and for PS it needs to be a Pscript based plug-in.
>
> Bitmap Image — Which component should i implement?
> Answer: Rendering plug-in with ImageProcessing and the approach outlined
> in my previous reply.
>
> - Ashwin
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Sushma Yella
> Sent: Tuesday, January 04, 2005 10:20 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL | PS | CAPSL)
> ?
>
>
> Thanks chirstoph and aswin for your replies. I need the data as a bitmap
> image. By your comments i understood that i need to do this in a custom
> print processor. Is this the correct component to be implemented? Any
> Suggestions?
>
> Chistoph, I have one more query. How do i capture the following format.
>
> GDI/EMF — Which component should i implement?
> PCL/PS ---- Which component should i implement?
> Bitmap Image — Which component should i implement?
>
> Thanks & Regards,
> Sush
>
> Christoph Lindemann wrote:
>
> I might have misunderstood what you want to accomplish.
>
> What do you mean by “RAW” data? Do yo! u want the data as GDI/EMF,
> the printers own mark-up language like PCL or PS, or do you want the
> data as bitmap image data?
>
> Regards,
> Christoph
>
> -----Original Message-----
> From: Sushma Yella [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 6:25 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver
>
>
> Hi Christoph,
>
> Thanks for the information and link. Im trying to
> capture the raw data. Can you tell me is this only possible by
> extracting the EMF file or can we caputure the data by writing a
> rendering plug-in. Any suggestions would help me?
>
> Thanks & Regards,
> Sush
>
> Christoph Lindemann
> wrote:
>
> Hi Sush,
>
> Extracting EMF data is not supported by
> Windows/Microsoft. If you want to do it anyway, you can find
> informations on how to do this at http://undocprint.printassociates.com/
> Here you can also fin! d a link to a open source project.
>
> Regards,
> Christoph Lindemann
>
> -----Original Message-----
> From: Sushma Yella
> [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 2:32 PM
> To: Windows System Software Devs
> Interest List
> Subject: [ntdev] Virtual Printer Driver
>
>
> Hello All,
>
> A very happy new year to all of you.
>
> I am developing a virtual printer
> driver. i used ddk provided sample gpd files to generate my minidriver.
> i want to capture the raw data instead of EMF data and send it to file
> rather than printer port. I used a rendering plug-in sample
> (src/print/oemdll/oemuni) and tried to modify accordingly. i changed the
> inf file and included the plug-in dll and installed the drivers. I tried
> to trace out by including some debugging messages, but i dint find my
> dllentry being called. Do i need to tell my mini driver to include and
> load the rendering plug-in also.
>
> Can any one help me out to sol! ve this
> problem?
>
> Do i really need to implement a
> rendering plug-in?
>
> Is there any sample available to capture
> the raw data?
>
> Thanks & Regards,
> Sush
>
>

>
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with
> new enhanced search. Learn more.
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently subscribed
> to ntdev as: xxxxx@printassociates.com To unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
> Do you Yahoo!?
> Send h! oliday email and support a worthy cause. Do good.
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently subscribed
> to ntdev as: xxxxx@printassociates.com To unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
>
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>

>
> Do you Yahoo!?
> Meet the all-new My Yahoo! - Try it today! —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently subscribed
> to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we. — Questions?
> First check the Kernel Driver FAQ at http://www.osronline.
> com/article.cfm?id=256 You are currently subscribed to ntdev as:
> xxxxx@3dlabs.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> ForwardSourceID:NT0000A422

Thanks Mat. I missed out few changes. With the following changes also, i could not see any data on my bitmap. Can anyone look into this code.

HRESULT __stdcall IOemUni::ImageProcessing(
PDEVOBJ pdevobj,
PBYTE pSrcBitmap,
PBITMAPINFOHEADER pBitmapInfoHeader,
PBYTE pColorTable,
DWORD dwCallbackID,
PIPPARAMS pIPParams,
OUT PBYTE *ppbResult)
{
RECT Rect;
Rect.left =Rect.top =0;
Rect.bottom = 600;
Rect.right = 600;
HDC hdcScreen = CreateDC(_T(“DISPLAY”), NULL, NULL, NULL);
HDC compDC = CreateCompatibleDC(hdcScreen/*NULL*/);
RECT RectRes;
RectRes.left =RectRes.top =0;
RectRes.bottom= (GetDeviceCaps(compDC , LOGPIXELSY) *
Rect.bottom * 10 )/(254);
RectRes.right = (GetDeviceCaps(compDC, LOGPIXELSX) *
Rect.right * 10) /254;
BITMAPINFO bmi;
BITMAPINFOHEADER *bmih = (BITMAPINFOHEADER *)&bmi;
LPBYTE pBits;
bmih->biSize = sizeof (BITMAPINFOHEADER) ;
bmih->biWidth = RectRes.right;
bmih->biHeight = RectRes.bottom;
bmih->biPlanes = 1 ;
bmih->biBitCount = 24 ;
bmih->biCompression = BI_RGB ;
bmih->biSizeImage = (((RectRes.right * 24 + 31) & ~31)/8)
* RectRes.bottom ;
bmih->biXPelsPerMeter = 0 ;
bmih->biYPelsPerMeter = 0 ;
bmih->biClrUsed = 0 ;
bmih->biClrImportant = 0 ;
HBITMAP hbm = CreateDIBSection (hdcScreen, (BITMAPINFO *) &bmi, 0, (void **)&pSrcBitmap, NULL, 0) ;
SelectObject(compDC , hbm);
BitBlt(compDC, 0, 0, bmih->biWidth, bmih->biHeight, hdcScreen, 0, 0, SRCCOPY);
PatBlt(compDC , 0,0,bmih->biWidth , bmih->biHeight , WHITENESS);

BITMAPFILEHEADER hdr;
HANDLE hf = CreateFile(_T(“t1.bmp”),
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
hdr.bfType = 0x4d42;
// Compute the size of the entire file.
hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof(RGBQUAD) + bmih->biSizeImage);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
// Compute the offset to the array of color indices.
hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) +
bmih->biSize + bmih->biClrUsed
* sizeof (RGBQUAD);
DWORD dwTmp;
// Copy the BITMAPFILEHEADER into the .BMP file.
WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), (LPDWORD) &dwTmp, NULL);
WriteFile(hf, (LPVOID) bmih, sizeof(BITMAPINFOHEADER) + bmih->biClrUsed * sizeof (RGBQUAD),
(LPDWORD) &dwTmp, ( NULL));
DWORD cb = bmih->biSizeImage;
WriteFile(hf, (LPSTR)pSrcBitmap, (int) cb, (LPDWORD) &dwTmp,NULL);
CloseHandle(hf);
DeleteDC(compDC);
DeleteObject(hbm);
return S_OK;
}

Regards,
Sush

Mats PETERSSON wrote:
I’ve never dealt with printer drivers, but surely you need to do SOMETHING
with teh original bitmap that came into the ImageProcessing call? By that,
I mean the pSrcBitmap and pBitmapInfoHeader. As far as I can see, all you
do is fill your local bitmap with white, and then write it to a file. I
would expect this to become a white bitmap in the file. You may want to
also bitblt the incoming bitmap into your local bitmap, and you may be able
to see something more useful.

But I may have missed something here…


Mats

---------------------------------
Do you Yahoo!?
The all-new My Yahoo! – What will yours do?

DQoNCg0KDQoNClRyeSBzd2FwcGluZyB0aG9zZSB0d28gYmxpdCdzLCBhcyB0aGUgc2Vjb25kIHdp
bGwgc2V0IHRoZSB3aG9sZSByZWN0YW5nbGUNCnRvIHdoaXRlLCBvdmVyd3JpdGluZyBhbnl0aGlu
ZyBkb25lIGluIHRoZSBmaXJzdCBibHQuDQoNCi0tDQpNYXRzDQoNCi0tLS0tLS0tIE5vdGljZSAt
LS0tLS0tLQ0KVGhlIGluZm9ybWF0aW9uIGluIHRoaXMgbWVzc2FnZSBpcyBjb25maWRlbnRpYWwg
YW5kIG1heSBiZSBsZWdhbGx5DQpwcml2aWxlZ2VkLiAgSXQgaXMgaW50ZW5kZWQgc29sZWx5IGZv
ciB0aGUgYWRkcmVzc2VlLiAgQWNjZXNzIHRvIHRoaXMNCm1lc3NhZ2UgYnkgYW55b25lIGVsc2Ug
aXMgdW5hdXRob3JpemVkLiAgSWYgeW91IGFyZSBub3QgdGhlIGludGVuZGVkDQpyZWNpcGllbnQs
IGFueSBkaXNjbG9zdXJlLCBjb3B5aW5nIG9yIGRpc3RyaWJ1dGlvbiBvZiB0aGUgbWVzc2FnZSwg
b3IgYW55DQphY3Rpb24gdGFrZW4gYnkgeW91IGluIHJlbGlhbmNlIG9uIGl0LCBpcyBwcm9oaWJp
dGVkIGFuZCBtYXkgYmUgdW5sYXdmdWwuDQpJZiB5b3UgaGF2ZSByZWNlaXZlZCB0aGlzIG1lc3Nh
Z2UgaW4gZXJyb3IsIHBsZWFzZSBkZWxldGUgaXQgYW5kIGNvbnRhY3QNCnRoZSBzZW5kZXIgaW1t
ZWRpYXRlbHkuIFRoYW5rIHlvdS4NCg0KDQpib3VuY2UtMTk3NTA1LTE0MDc5QGxpc3RzLm9zci5j
b20gd3JvdGUgb24gMDEvMDUvMjAwNSAwMzozMDoxMyBQTToNCg0KPg0KPiBUaGFua3MgTWF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IHlvdQ0K
PiBkbyBpcyBmaWxsIHlvdXIgbG9jYWwgYml0bWFwIHdpdGggd2hpdGUsIGFuZCB0aGVuIHdyaXRl
IGl0IHRvIGEgZmlsZS4gSQ0KPiB3b3VsZCBleHBlY3QgdGhpcyB0byBiZWNvbWUgYSB3aGl0ZSBi
aXRtYXAgaW4gdGhlIGZpbGUuIFlvdSBtYXkgd2FudCB0bw0KPiBhbHNvIGJpdGJsdCB0aGUgaW5j
b21pbmcgYml0bWFwIGludG8geW91ciBsb2NhbCBiaXRtYXAsIGFuZCB5b3UgbWF5IGJlDQphYmxl
DQo+IHRvIHNlZSBzb21ldGhpbmcgbW9yZSB1c2VmdWwuDQo+DQo+IEJ1dCBJIG1heSBoYXZlIG1p
c3NlZCBzb21ldGhpbmcgaGVyZS4uLg0KPg0KPiAtLQ0KPiBNYXRzDQoNCj4gRG8geW91IFlhaG9v
IT8NCj4gVGhlIGFsbC1uZXcgTXkgWWFob28hIOKAkyBXaGF0IHdpbGwgeW91cnMgZG8/IC0tLSBR
dWVzdGlvbnM/IEZpcnN0DQo+IGNoZWNrIHRoZSBLZXJuZWwgRHJpdmVyIEZBUSBhdA0KaHR0cDov
L3d3dy5vc3JvbmxpbmUuY29tL2FydGljbGUuY2ZtP2lkPTI1Ng0KPiBZb3UgYXJlIGN1cnJlbnRs
eSBzdWJzY3JpYmVkIHRvIG50ZGV2IGFzOiBtYXRzLnBldGVyc3NvbkAzZGxhYnMuY29tDQo+IFRv
IHVuc3Vic2NyaWJlIHNlbmQgYSBibGFuayBlbWFpbCB0byBsZWF2ZS1udGRldi0xNDA3OUNAbGlz
dHMub3NyLmNvbQ0KPiBGb3J3YXJkU291cmNlSUQ6TlQwMDAwQTQ0Ng==

My suggestions would be:

GDI/EMF:
How to implement, depends on the compatibility needed, see one of my
previous mails. The PrintMirror project uses a rendering plugin, I think.
If you only need bitmap data, I would strongly advise you against trying to
implement it this way.

PCL/PS:
I would implement a custom Print Monitor (Port Monitor) to capture the
resulting PCL from a printer driver. But then again, Ashwins suggestion
might also work, I have not tried it.

Bitmap:
Go with Ashwin suggestion. I think there was also an example in the NT4 DDK,
but I’m not sure.

Regards,
Christoph

-----Original Message-----
From: Ashwin Needamangala [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, January 05, 2005 7:35 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL |
PS | CAPSL)
?

No…you should write a rendering plug-in and follow the approach I
outlined in my previous reply.

Regarding your other question:

GDI/EMF — Which component should i implement?
Answer: EMF is the spool file format…so if all you need is a bitmap
image, I don’t see why you need to capture EMF. Also, note
that for any
given job, there is no guarantee that EMF is the format used for
spooling…it could be RAW as well.

PCL/PS ---- Which component should i implement?
Answer: Rendering plug-in…for PCL it needs to be a Unidrv based
rendering plug-in and for PS it needs to be a Pscript based plug-in.

Bitmap Image — Which component should i implement?
Answer: Rendering plug-in with ImageProcessing and the
approach outlined
in my previous reply.

  • Ashwin

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sushma Yella
Sent: Tuesday, January 04, 2005 10:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL |
PS | CAPSL)
?

Thanks chirstoph and aswin for your replies. I need the data
as a bitmap
image. By your comments i understood that i need to do this
in a custom
print processor. Is this the correct component to be implemented? Any
Suggestions?

Chistoph, I have one more query. How do i capture the
following format.

GDI/EMF — Which component should i implement?
PCL/PS ---- Which component should i implement?
Bitmap Image — Which component should i implement?

Thanks & Regards,
Sush

Christoph Lindemann wrote:
>
> I might have misunderstood what you want to accomplish.
>
> What do you mean by “RAW” data? Do you want the data as GDI/EMF,
> the printers own mark-up language like PCL or PS, or do you want the
> data as bitmap image data?
>
> Regards,
> Christoph
>
> -----Original Message-----
> From: Sushma Yella [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 6:25 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver
>
>
> Hi Christoph,
>
> Thanks for the information and link. Im trying to
> capture the raw data. Can you tell me is this only possible by
> extracting the EMF file or can we caputure the data by writing a
> rendering plug-in. Any suggestions would help me?
>
> Thanks & Regards,
> Sush
>
> Christoph Lindemann
> wrote:
>
> Hi Sush,
>
> Extracting EMF data is not supported by
> Windows/Microsoft. If you want to do it anyway, you can find
> informations on how to do this at
> http://undocprint.printassociates.com/
> Here you can also find a link to a open source project.
>
> Regards,
> Christoph Lindemann
>
> -----Original Message-----
> From: Sushma Yella
> [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 2:32 PM
> To: Windows System Software Devs
> Interest List
> Subject: [ntdev] Virtual Printer Driver
>
>
> Hello All,
>
> A very happy new year to all of you.
>
> I am developing a virtual printer
> driver. i used ddk provided sample gpd files to generate my
> minidriver.
> i want to capture the raw data instead of EMF data and send it to file
> rather than printer port. I used a rendering plug-in sample
> (src/print/oemdll/oemuni) and tried to modify accordingly. i
> changed the
> inf file and included the plug-in dll and installed the
> drivers. I tried
> to trace out by including some debugging messages, but i dint find my
> dllentry being called. Do i need to tell my mini driver to include and
> load the rendering plug-in also.
>
> Can any one help me out to solve this
> problem?
>
> Do i really need to implement a
> rendering plug-in?
>
> Is there any sample available to capture
> the raw data?
>
> Thanks & Regards,
> Sush
>
>
>
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with
> new enhanced search. Learn more.
> http:> mail_250>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@printassociates.com To
> unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>

>
> Do you Yahoo!?
> Send holiday email and support a worthy cause. Do good.
> http:</http:>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@printassociates.com To
> unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
>
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> ________________________________
>
> Do you Yahoo!?
> Meet the all-new My Yahoo! http: - Try it today! —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></http:></http:>

Hello All,

I have implemented the rendereing plug-in. I added my bitmap driver implementation in ImageProcessing function. The bitmap image is created with blurred data in it. I could not figure out where im going wrong and moreover my ImageProcessing function is called only once for whatever the size of data i give for printing. Do i need to change anything in my minidriver GPD. I used the sample oem.gpd provided by DDK (src\print\oemdll). Any pointers would help me.

Here is the portion of my GPD which i changed.

*Feature: ColorMode
{
*rcNameID: =COLOR_PRINTING_MODE_DISPLAY
*HelpIndex: 12004
*DefaultOption: Color
*Option: Color
{
*rcNameID: =COLOR_DISPLAY
*DevNumOfPlanes: 0
*DevBPP: 0
*DrvBPP: 24
*ColorPlaneOrder: LIST(YELLOW, MAGENTA, CYAN, BLACK)
*Color? : TRUE
*IPCallbackID: 1
*RasterMode: DIRECT
*Constraints: LIST (Halftone.HT_PATSIZE_AUTO,

  • Halftone.HT_PATSIZE_SUPERCELL_M,
  • Halftone.HT_PATSIZE_6x6_M,
  • Halftone.HT_PATSIZE_8x8_M)
    *Command: CmdEnableDRC { *Cmd : “<1B>*b3M” }
    *PaletteSize: 256
    *PaletteProgrammable? : TRUE
    *Command: CmdDefinePaletteEntry { *Cmd : “<1B>*v” %d{RedValue}“a” %d{GreenValue}“b” %d{BlueValue}“c” %d{PaletteIndexToProgram}
  • “I” }
    *Command: CmdSelectPaletteEntry { *Cmd : “<1B>*v” %d{CurrentPaletteIndex}“S” }
    *Command: CmdSetSrcBmpWidth { *Cmd : “<1B>*r” %d{RasterDataWidthInBytes / 3}“S” }
    *Command: CmdSelect
    {
    *Order: PAGE_SETUP.16
    *Cmd: “<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*”
  • “o3W<060400>”
    }
    }
    }
    *Feature: Halftone
    {
    *rcNameID: =HALFTONING_DISPLAY
    *HelpIndex: 12005
    *Option: HT_PATSIZE_AUTO
    {
    *rcNameID: =HT_AUTO_SELECT_DISPLAY
    }
    *Option: HT_PATSIZE_SUPERCELL_M
    {
    *rcNameID: =HT_SUPERCELL_DISPLAY
    }
    *Option: HT_PATSIZE_6x6_M
    {
    *rcNameID: =HT_DITHER6X6_DISPLAY
    }
    *Option: HT_PATSIZE_8x8_M
    {
    *rcNameID: =HT_DITHER8X8_DISPLAY
    }
    }

Thanks & Regards,
Sush

Christoph Lindemann wrote:
My suggestions would be:

GDI/EMF:
How to implement, depends on the compatibility needed, see one of my
previous mails. The PrintMirror project uses a rendering plugin, I think.
If you only need bitmap data, I would strongly advise you against trying to
implement it this way.

PCL/PS:
I would implement a custom Print Monitor (Port Monitor) to capture the
resulting PCL from a printer driver. But then again, Ashwins suggestion
might also work, I have not tried it.

Bitmap:
Go with Ashwin suggestion. I think there was also an example in the NT4 DDK,
but I’m not sure.

Regards,
Christoph

> -----Original Message-----
> From: Ashwin Needamangala [mailto:xxxxx@windows.microsoft.com]
> Sent: Wednesday, January 05, 2005 7:35 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL |
> PS | CAPSL)
> ?
>
>
> No…you should write a rendering plug-in and follow the approach I
> outlined in my previous reply.
>
> Regarding your other question:
>
> GDI/EMF — Which component should i implement?
> Answer: EMF is the spool file format…so if all you need is a bitmap
> image, I don’t see why you need to capture EMF. Also, note
> that for any
> given job, there is no guarantee that EMF is the format used for
> spooling…it could be RAW as well.
>
> PCL/PS ---- Which component should i implement?
> Answer: Rendering plug-in…for PCL it needs to be a Unidrv based
> rendering plug-in and for PS it needs to be a Pscript based plug-in.
>
> Bitmap Image — Which component should i implement?
> Answer: Rendering plug-in with ImageProcessing and the
> approach outlined
> in my previous reply.
>
> - Ashwin
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Sushma Yella
> Sent: Tuesday, January 04, 2005 10:20 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver -> RAW = (PCL |
> PS | CAPSL)
> ?
>
>
> Thanks chirstoph and aswin for your replies. I need the data
> as a bitmap
> image. By your comments i understood that i need to do this
> in a custom
> print processor. Is this the correct component to be implemented? Any
> Suggestions?
>
> Chistoph, I have one more query. How do i capture the
> following format.
>
> GDI/EMF — Which component should i implement?
> PCL/PS ---- Which component should i implement?
> Bitmap Image — Which component should i implement?
>
> Thanks & Regards,
> Sush
>
> Christoph Lindemann wrote:
>
> I might have misunderstood what you want to accomplish.
>
> What do you mean by “RAW” data? Do you want the data as GDI/EMF,
> the printers own mark-up language like PCL or PS, or do you want the
> data as bitmap image data?
>
> Regards,
> Christoph
>
> -----Original Message-----
> From: Sushma Yella [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 6:25 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Virtual Printer Driver
>
>
> Hi Christoph,
>
> Thanks for the information and link. Im trying to
> capture the raw data. Can you tell me is this only possible by
> extracting the EMF file or can we caputure the data by writing a
> rendering plug-in. Any suggestions would help me?
>
> Thanks & Regards,
> Sush
>
> Christoph Lindemann
> wrote:
>
> Hi Sush,
>
> Extracting EMF data is not supported by
> Windows/Microsoft. If you want to do it anyway, you can find
> informations on how to do this at
> http://undocprint.printassociates.com/
> Here you can also find a link to a open source project.
>
> Regards,
> Christoph Lindemann
>
> -----Original Message-----
> From: Sushma Yella
> [mailto:xxxxx@yahoo.com]
> Sent: Monday, January 03, 2005 2:32 PM
> To: Windows System Software Devs
> Interest List
> Subject: [ntdev] Virtual Printer Driver
>
>
> Hello All,
>
> A very happy new year to all of you.
>
> I am developing a virtual printer
> driver. i used ddk provided sample gpd files to generate my
> minidriver.
> i want to capture the raw data instead of EMF data and send it to file
> rather than printer port. I used a rendering plug-in sample
> (src/print/oemdll/oemuni) and tried to modify accordingly. i
> changed the
> inf file and included the plug-in dll and installed the
> drivers. I tried
> to trace out by including some debugging messages, but i dint find my
> dllentry being called. Do i need to tell my mini driver to include and
> load the rendering plug-in also.
>
> Can any one help me out to solve this
> problem?
>
> Do i really need to implement a
> rendering plug-in?
>
> Is there any sample available to capture
> the raw data?
>
> Thanks & Regards,
> Sush
>
>

>
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with
> new enhanced search. Learn more.
> > mail_250>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@printassociates.com To
> unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
> Do you Yahoo!?
> Send holiday email and support a worthy cause. Do good.
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@printassociates.com To
> unsubscribe send
> a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@yahoo.com
>
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>

>
> Do you Yahoo!?
> Meet the all-new My Yahoo! - Try it today! —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed
> to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


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

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.