I have a monolithic printerdriver under XP, but I can NOT seem to figure out
how to read paper information from MS Word.

In DrvDocumentPropertySheets, where I would expect to get the information,
the DEVMODE from Word just returns my internal paper settings that I
provided on first call, and I can NOT seem to force it to do otherwise.

Any help ?

RE: Q:Printer driver, paper information from MS Word by Kiran

Kiran
Thu Sep 16 21:07:05 CDT 2004

Did you mean Paper Size of each Page?
MS-Word gets all the supported Paper sizes from
DrvDeviceCapabilities(DC_PAPERxxx).
For each Paper size in the document, You get in DrvEnablePDEV at the time of
printing.

-Kiran

"Mr. B" wrote:

> I have a monolithic printerdriver under XP, but I can NOT seem to figure out
> how to read paper information from MS Word.
>
> In DrvDocumentPropertySheets, where I would expect to get the information,
> the DEVMODE from Word just returns my internal paper settings that I
> provided on first call, and I can NOT seem to force it to do otherwise.
>
> Any help ?
>
>
>
>
>

Re: Q:Printer driver, paper information from MS Word by Mr

Mr
Fri Sep 17 02:52:27 CDT 2004

"Kiran" wrote...

> Did you mean Paper Size of each Page?

Yes, I simply want to know what papersize MS-Word are using for the document
being printed

> MS-Word gets all the supported Paper sizes from
> DrvDeviceCapabilities(DC_PAPERxxx).

Maybe that is what I am missing
I is a custom papersize in MS-Word and as I have endless paper, I can always
sclare this papersize to fit my endless paper.

> For each Paper size in the document, You get in DrvEnablePDEV at the time
of
> printing.

Actually I came up with this behaviour.
In first DrvDocumentPropertySheets I first only set DM_PAPERSIZE to custom.
In next DrvDocumentPropertySheets I then get a DEVMODE where DM_PAPERWIDTH
and DM_PAPERLENGTH are set, and containing data.
Only bad thing so far is that they doesnt seem to contain the papersize from
MS-Word




Re: Q:Printer driver, paper information from MS Word by Judy

Judy
Mon Sep 20 11:32:08 CDT 2004

"Mr. B" <ask@me> wrote in news:OntsHtInEHA.3988@TK2MSFTNGP10.phx.gbl:
> Actually I came up with this behaviour.
> In first DrvDocumentPropertySheets I first only set DM_PAPERSIZE to
> custom. In next DrvDocumentPropertySheets I then get a DEVMODE where
> DM_PAPERWIDTH and DM_PAPERLENGTH are set, and containing data.
> Only bad thing so far is that they doesnt seem to contain the
> papersize from MS-Word
>
>
>
>

Word will start off by creating a DC with the default paper size for the
queue and will then use ResetDC (at the GDI level) to select a new paper
size, when needed, for each section of the document.
At the driver level, you will see calls to DrvEnablePDEV for each CreateDC
from Word, followed by N calls to DrvResetPDEV for each ResetDC.
In my experience you can easily get 6 or more calls to DrvResetPDEV before
you are asked to actually draw anything on the page.

Judy