Hi.

I have to write a print processor that extracts custom features added
to the PPD-file of a PS printer. To my understanding, the features are
saved in the private area of DEVMODE, but I can't find them. When I use
WinPrint and RAW, the features are included in the output, so I know
it's possible.

/Erik

RE: Extract custom PPD-features in print processor. by bobbym

bobbym
Fri Jul 01 19:19:14 CDT 2005

------=_NextPart_0001_1EF316DA
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


--------------------
From: "Erik" <erik.hermansson@bredband.net>
Newsgroups: microsoft.public.development.device.drivers
Subject: Extract custom PPD-features in print processor.
Date: 1 Jul 2005 01:50:40 -0700
Organization: http://groups.google.com

Hi.

I have to write a print processor that extracts custom features added
to the PPD-file of a PS printer. To my understanding, the features are
saved in the private area of DEVMODE, but I can't find them. When I use
WinPrint and RAW, the features are included in the output, so I know
it's possible.

/Erik

The source for winprint is included as the Genprint sample.
Please take a look.

Hope this helps.

Thank you,
Bobby Mattappally
Microsoft

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

------=_NextPart_0001_1EF316DA
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20
\par \pard\li720 --------------------
\par From: "Erik" <erik.hermansson@bredband.net>
\par Newsgroups: microsoft.public.development.device.drivers
\par Subject: Extract custom PPD-features in print processor.
\par Date: 1 Jul 2005 01:50:40 -0700
\par Organization: http://groups.google.com
\par
\par Hi.
\par
\par I have to write a print processor that extracts custom features added
\par to the PPD-file of a PS printer. To my understanding, the features are
\par saved in the private area of DEVMODE, but I can't find them. When I use
\par WinPrint and RAW, the features are included in the output, so I know
\par it's possible.
\par
\par /Erik
\par
\par \pard The source for winprint is included as the Genprint sample.
\par Please take a look.
\par
\par Hope this helps.
\par
\par Thank you,
\par Bobby Mattappally
\par Microsoft
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_1EF316DA--


Re: Extract custom PPD-features in print processor. by Erik

Erik
Tue Jul 12 01:51:49 CDT 2005

Thank you, but that didn't help me very much. I had already looked
through the whole Genprint example without any luck. I have move on to
use the JOB_INFO_2 structure to send data from the driver to the print
processor. Now I have other problems.

I have modified the PSUIREP example and added a custom sheet. I use a
singleton to store my custom data, but the changes made to the
singleton in the oemui.cpp file during runtime isn't reflected in the
intrface.cpp file. I still only get the default values. I have come to
suspect that they run in different threads. Am I correct?


Re: Extract custom PPD-features in print processor. by Naveen

Naveen
Tue Jul 12 19:34:04 CDT 2005

Use custom Escapes to exchange data between driver and Print proceesor.
Look for ExtEscape function...

Hope this helps..

-Naveen

"Erik" wrote:

> Thank you, but that didn't help me very much. I had already looked
> through the whole Genprint example without any luck. I have move on to
> use the JOB_INFO_2 structure to send data from the driver to the print
> processor. Now I have other problems.
>
> I have modified the PSUIREP example and added a custom sheet. I use a
> singleton to store my custom data, but the changes made to the
> singleton in the oemui.cpp file during runtime isn't reflected in the
> intrface.cpp file. I still only get the default values. I have come to
> suspect that they run in different threads. Am I correct?
>
>

Re: Extract custom PPD-features in print processor. by Erik

Erik
Wed Jul 13 08:50:04 CDT 2005

The problem is no longer sending data between the driver and the print
processor. The problem is moving data from the UI callback functions to
the interface-object in the driver. I tried to use a singleton, but the
interface doesn't register the changes I make from the callback
functions. It's as if they work in different scopes when they
shouldn't. I suspect that they run in two different threads.


Re: Extract custom PPD-features in print processor. by Naveen

Naveen
Wed Jul 13 18:30:03 CDT 2005

I could not understand what exactly you ar looking for... Can you explain in
more detail what exactly is the problem and what you are trying to do...

-Navee

"Erik" wrote:

> The problem is no longer sending data between the driver and the print
> processor. The problem is moving data from the UI callback functions to
> the interface-object in the driver. I tried to use a singleton, but the
> interface doesn't register the changes I make from the callback
> functions. It's as if they work in different scopes when they
> shouldn't. I suspect that they run in two different threads.
>
>

Re: Extract custom PPD-features in print processor. by Erik

Erik
Thu Jul 14 02:08:36 CDT 2005

Sure.
I'm developing both a printer driver and a print processor.
The print processor is going to send data via HTTP to a service
somewhere in the network. This service will handle all the print jobs.
I want to add to the printer driver a custom sheet with service
specific controls, and then extract their settings in the print
processor and add them to the HTTP-headers. I have customized the
PSUIREP-example from the DDK, and added a sheet made out of standard
Windows components, not printer driver option-types. I'm no longer
using the PPD-file for my custom features.

I have successfully passed data from the driver to the print processor,
so I know that will work. I just added some static data to the
pParameters field in the JOB_INFO_2 structure in the
IPrintOemUI2::DocumentEvent method when iEsc ==
DOCUMENTEVENT_STARTDOCPOST. The problem is that I now want to replace
that static data with the settings from the custom sheet. The sheets
are defined in the oemui.cpp-file, and I have problems accessing that
data from the IPrintOemUI2::DocumentEvent method. As I wrote earlier, I
tried to use a singleton-class to hold my data, but it's not working.
The changes I make to it from oemui.cpp isn't showing in DocumentEvent.
It still only gets the default data. Is there an easier way of doing
this?

Thanks /Erik


Re: Extract custom PPD-features in print processor. by Naveen

Naveen
Fri Jul 15 01:35:03 CDT 2005

Well, What I understand is that you have added 1 sheet in UI that have some
cotrols and you are not able to save the settings of that control. Correct me
if I am worng.

Well if that is the case then the easiest way is to add your custom fields
in private devmode. see devmode.h. Initialize all the fields in devmode.cpp.

From hrOEMDocumentPropertySheets where you are adding your sheet pass
userdata to the sheet in sheet.lParam. So you will be able to access devmode
in your dialog handeler ...when you click apply save everything in devmode.

So all your settings will be saved. To get devmode in printprocessor send
ExtEscape from prinprocessor and get private devmode. This way you will have
all settings of devmode in Printproc.

If you are addiing fields in devmode you have to write renderer also. There
will be no change in renderer except devmode.h and devmoe.cpp. Size f the
devmode should be same in renderer and UI.

Let me know if I understood your problem correctly...and if this helps...

-Naveen


"Erik" wrote:

> Sure.
> I'm developing both a printer driver and a print processor.
> The print processor is going to send data via HTTP to a service
> somewhere in the network. This service will handle all the print jobs.
> I want to add to the printer driver a custom sheet with service
> specific controls, and then extract their settings in the print
> processor and add them to the HTTP-headers. I have customized the
> PSUIREP-example from the DDK, and added a sheet made out of standard
> Windows components, not printer driver option-types. I'm no longer
> using the PPD-file for my custom features.
>
> I have successfully passed data from the driver to the print processor,
> so I know that will work. I just added some static data to the
> pParameters field in the JOB_INFO_2 structure in the
> IPrintOemUI2::DocumentEvent method when iEsc ==
> DOCUMENTEVENT_STARTDOCPOST. The problem is that I now want to replace
> that static data with the settings from the custom sheet. The sheets
> are defined in the oemui.cpp-file, and I have problems accessing that
> data from the IPrintOemUI2::DocumentEvent method. As I wrote earlier, I
> tried to use a singleton-class to hold my data, but it's not working.
> The changes I make to it from oemui.cpp isn't showing in DocumentEvent.
> It still only gets the default data. Is there an easier way of doing
> this?
>
> Thanks /Erik
>
>

Re: Extract custom PPD-features in print processor. by Erik

Erik
Mon Jul 18 01:25:19 CDT 2005

Thanks. It works. Just one problem: my string turns into a sequence of
a character and null. Instead of [h][e][l][l][o] it's
[h][\0][e][\0][l][\0][l][\0][e][\0]. Is that normal?

/Erik


Re: Extract custom PPD-features in print processor. by Naveen

Naveen
Mon Jul 18 05:07:02 CDT 2005

Thats absolutly fine...as it is UNICODE ...So all charcters will be 2 bytes..
Use TCHAR routines to manupulate ...

Hpe this helps...

-Naveen

"Erik" wrote:

> Thanks. It works. Just one problem: my string turns into a sequence of
> a character and null. Instead of [h][e][l][l][o] it's
> [h][\0][e][\0][l][\0][l][\0][e][\0]. Is that normal?
>
> /Erik
>
>

Re: Extract custom PPD-features in print processor. by Erik

Erik
Mon Jul 18 09:03:28 CDT 2005

Thank you. This is my first time programming for Windows not using C#,
so I have to learn as I go.

/Erik