microsoft word not being able to print images properly

I’m trying to develop a printer driver that would render the output pages properly. However, the image (bit-block transfer) related hooks don’t print properly. Here is the log file of the print sequence if you’re interested (I think it may help, but sorry for cluttering the message). There is one thing that is interesting going on. DrvEscape is called, but I haven’t implemented it yet. Would this callback need to be implemented in order for Microsoft Word to call the callbacks appropriate in its own application?

DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215088828 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215088820 bytes)
DirectDrvDocumentPropertySheets - I was asked to update pdmOut from my internal DEVMODE
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDeviceCapabilities - DC_PAPERSIZE
DrvDeviceCapabilities - DC_PAPERSIZE
DrvDocumentEvent
DrvDocumentEvent - QUERYFILTER
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPRE
DrvEnablePdev
DrvCompletePDEV
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215088680 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215088672 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPOST
DrvDocumentEvent
DrvDocumentEvent - DELETEDC
DrvDisablePDEV
DrvDeviceCapabilities - DC_PAPERNAMES
DrvDeviceCapabilities - DC_MEDIAREADY
DrvDeviceCapabilities - DC_PAPERNAMES
DrvDeviceCapabilities - DC_MEDIAREADY
DrvDocumentEvent
DrvDocumentEvent - STARTDOC
DrvEnableSurface
DrvStartDoc
DrvDocumentEvent
DrvDocumentEvent - STARTDOCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235764 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - QUERYFILTER
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPRE
DrvEnablePdev
DrvEnablePdev - the given DEVMODE is not an extended DEVMODE! Falling back to the defaults
DrvCompletePDEV
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235640 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235632 bytes)
DirectDrvDocumentPropertySheets - I was asked to update pdmOut from my internal DEVMODE
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - ESCAPE
DrvEscape
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215087744 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - RESETDCPRE
DrvEnablePdev
DrvEnablePdev - the given DEVMODE is not an extended DEVMODE! Falling back to the defaults
DrvCompletePDEV
DrvResetPDEV
DrvDisableSurface
DrvDisablePDEV
DrvEnableSurface
DrvStartDoc
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215087712 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 215087704 bytes)
DirectDrvDocumentPropertySheets - I was asked to update pdmOut from my internal DEVMODE
DrvDocumentEvent
DrvDocumentEvent - RESETDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - STARTPAGE
DrvStartPage
DrvStartPage - Attempt to Create PDF page
DrvDocumentEvent
DrvDocumentEvent - ENDPAGE
DrvSendPage
DrvSendPage - Attempt to end PDF page
DrvDocumentEvent
DrvDocumentEvent - ENDDOC
DrvEndDoc
DrvEndDoc - Attempting to Save PDF document
DrvDisableSurface
DrvDocumentEvent
DrvDocumentEvent - ENDDOCPOST
DrvDocumentEvent
DrvDocumentEvent - DELETEDC
DrvDisablePDEV

xxxxx@hotmail.com wrote:

I’m trying to develop a printer driver that would render the output pages properly. However, the image (bit-block transfer) related hooks don’t print properly.

What, exactly, do you see that doesn’t work?

Here is the log file of the print sequence if you’re interested (I think it may help, but sorry for cluttering the message). There is one thing that is interesting going on. DrvEscape is called, but I haven’t implemented it yet. Would this callback need to be implemented in order for Microsoft Word to call the callbacks appropriate in its own application?

No. For a PostScript driver, Word will try to use the ExtEscape call to
send raw PostScript to the driver, but that support shouldn’t be required.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

From the log file, I can’t see any of the calls of DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvPlgBlt, DrvTransparentBlt, etc. when I have printed a word document with an image embedded. From my understanding, those callbacks are responsible for performing the different types of bit-block transfer.

xxxxx@hotmail.com wrote:

From the log file, I can’t see any of the calls of DrvBitBlt, DrvCopyBits, DrvStretchBlt, DrvPlgBlt, DrvTransparentBlt, etc. when I have printed a word document with an image embedded. From my understanding, those callbacks are responsible for performing the different types of bit-block transfer.

Is your surface a GDI-manged surface? Did you include those entry
points in your DRVFN array and set the corresponding HOOK bits in
DrvEnableSurface?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

My surface is a GDI managed surface. I have included the entry points in my DRVFN array in DrvEnableDriver and I have also set the corresponding HOOK bits in DrvEnableSurface. It’s just that when I print the document using Microsoft Internet Explorer, the page is rendered, but when I used a different application to print a similar document (in terms of content) such as Mozilla Firefox or Microsoft Word, the page doesn’t get rendered at all b/c the appropriate callbacks aren’t even called.

  1. That is ***extremely*** large for a devmode.
  2. Your printer driver’s devmode changes size between calls?

ScottR

-----Original Message-----
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 215088828 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 215088820 bytes)

  1. What would go significantly wrong if I have a large sized devmode? The reason is that I have some random junk which is not doing anything useful in the extended devmode structure at the moment.

  2. Should the devmode structure’s size be constant between calls?

The DEVMODE’s dmDriverExtra member is a WORD, so with 200+ MB you are
clearly overflowing it. Windows will think it’s 64K at most, and you
will be reading/writing random parts of memory beyond that.

Also, the default devmode is saved in the registry. A 200+ MB registry
entry seems excessive. I don’t know if anything will go wrong. I read
once that a registry entry of 4k was as large as you should go. That
was a long time ago, and probably for applications not drivers, so maybe
it’s increased since then. But surely not to 200MB.

I don’t know if windows requires or enforces or even assumes that the
amount of driver’s extra data is constant. But it never occured to me
(before today) that it would/could be variable sized.

It wouldn’t surprise me if the limit is actually 64K minus (the size of
public portion of devmode).

It seems to me that you must be storing stuff in the devmode that most
people would store in the PDEV. For example, job-specific data? The
DEVMODE is for driver ‘configuration’ information (margins, rendering
options, things like that). Print job data (ie, bitmaps from word)
should not go in the devmode.

How to use a devmode (from the application perspective, but possibly
helpful):
http://msdn.microsoft.com/en-us/library/ms794632.aspx

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, August 19, 2008 12:51 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] microsoft word not being able to print images
properly

  1. What would go significantly wrong if I have a large sized devmode?
    The reason is that I have some random junk which is not doing anything
    useful in the extended devmode structure at the moment.

  2. Should the devmode structure’s size be constant between calls?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

Please ignore what is being said in the log file for the DEVMODE size. After checking it with a debugger, it appears that the log file isn’t written properly with respect to arguments. The size is around 260 bytes for the entire devmode structure, and it’s constant. However, I’m still not entirely sure how this could affect how the DDI Hooks are being called by Word such that the image hooks are not even called.

Having a constant sized devmode approx 260 bytes wouldn’t. Having a
variable-sized 200+ MB devmode would, that was my point.

One thing Word does that many apps don’t do is call resetpdev. Are you
sure you are handling it correctly?

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, August 20, 2008 2:04 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] microsoft word not being able to print images
properly

Please ignore what is being said in the log file for the DEVMODE size.
After checking it with a debugger, it appears that the log file isn’t
written properly with respect to arguments. The size is around 260 bytes
for the entire devmode structure, and it’s constant. However, I’m still
not entirely sure how this could affect how the DDI Hooks are being
called by Word such that the image hooks are not even called.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

If DrvResetPDEV’s purpose is to copy the state of the old pdev to the new pdev, then I guess the functionality of the rendering API side doesn’t really need to copy the state, hence I commented out the entire function altogether as well as in the DRVFN array. Is this function essential even for printer drivers (I’m storing the font files somewhat differently than suggested in the documentation)?

My resetpdev cleans up the old one in addition to moving state to the
new one.

Why don’t you think copying the state to the new one is important? The
new one is the one which will be passed to all subsequent calls.

Also, your log shows it was called, so either you didn’t remove it from
the drvfn array or your logging code is massively confused.

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, August 20, 2008 5:25 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] microsoft word not being able to print images
properly

If DrvResetPDEV’s purpose is to copy the state of the old pdev to the
new pdev, then I guess the functionality of the rendering API side
doesn’t really need to copy the state, hence I commented out the entire
function altogether as well as in the DRVFN array. Is this function
essential even for printer drivers (I’m storing the font files somewhat
differently than suggested in the documentation)?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

After removing DrvResetPDEV (which is not needed for my driver b/c most of the objects are automatically cleaned up and not supposed to be copied), I’m now getting DrvBitBlt calls again. Maybe it’s perhaps I have modified some behaviour in DrvDeviceCapabilities callback in the printer interface dll. However, when I tried to debug the printing process, I’m getting an exception thrown at me with the following message:

“Unhandled exception at 0x730068cf in WINWORD.EXE: 0xC0000005: Access violation reading location 0x01999000.”

It appears that now Word is calling DrvBitBlt numerous times (even though that I only have one image in the document. But I’m experiencing an exception thrown at me when I’m in debug mode

Below is the log:
DrvDocumentEvent
DrvDocumentEvent - STARTDOC
DrvEnableSurface
DrvStartDoc
DrvDocumentEvent
DrvDocumentEvent - STARTDOCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235764 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - QUERYFILTER
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPRE
DrvEnablePdev
DrvCompletePDEV
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235640 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 1235632 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - ESCAPE
Processing Escape Query
DrvEscape
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 108526208 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - RESETDCPRE
DrvEnablePdev
DrvCompletePDEV
DrvDisableSurface
DrvDisablePDEV
DrvEnableSurface
DrvStartDoc
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 108526176 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which is 108526168 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - RESETDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - STARTPAGE
DrvStartPage
DrvStartPage - Attempt to Create PDF page
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvBitBlt
DrvTextOut
DrvTextOut
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvDocumentEvent
DrvDocumentEvent - ENDPAGE
DrvSendPage
DrvSendPage - Attempt to end PDF page
DrvDocumentEvent
DrvDocumentEvent - ENDDOC
DrvEndDoc
DrvEndDoc - Attempting to Save PDF document
DrvDisableSurface
DrvDocumentEvent
DrvDocumentEvent - ENDDOCPOST
DrvDocumentEvent
DrvDocumentEvent - DELETEDC
DrvDisablePDEV

Well, it appears that SendPage and EndDoc are getting called, so if you
print to file are the results correct? Since DisablePDEV is the last
function in your log, you might want to look at it’s code and see if
it’s doing something that could be causing a access violation.

Depending on your driver, Windows may break up a bitmap into several
calls.

This statement: “most of the objects are automatically cleaned up and
not supposed to be copied” is suspicious, because “automatically cleaned
up” makes me think of C++ and “not supposed to be copied” is just
suspicious in general.

But you didn’t really ask a question here, so I’m just guessing at what
you want. You don’t mention WHICH debugger, are you asking for help on
using a debugger?

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Thursday, August 21, 2008 3:11 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] microsoft word not being able to print images
properly

After removing DrvResetPDEV (which is not needed for my driver b/c most
of the objects are automatically cleaned up and not supposed to be
copied), I’m now getting DrvBitBlt calls again. Maybe it’s perhaps I
have modified some behaviour in DrvDeviceCapabilities callback in the
printer interface dll. However, when I tried to debug the printing
process, I’m getting an exception thrown at me with the following
message:

“Unhandled exception at 0x730068cf in WINWORD.EXE: 0xC0000005: Access
violation reading location 0x01999000.”

It appears that now Word is calling DrvBitBlt numerous times (even
though that I only have one image in the document. But I’m experiencing
an exception thrown at me when I’m in debug mode

Below is the log:
DrvDocumentEvent
DrvDocumentEvent - STARTDOC
DrvEnableSurface
DrvStartDoc
DrvDocumentEvent
DrvDocumentEvent - STARTDOCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 1235764 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal
DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - QUERYFILTER
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPRE
DrvEnablePdev
DrvCompletePDEV
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 1235640 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 1235632 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal
DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - CREATEDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - ESCAPE
Processing Escape Query
DrvEscape
DrvDeviceCapabilities - DC_COPIES
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 108526208 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal
DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - RESETDCPRE
DrvEnablePdev
DrvCompletePDEV
DrvDisableSurface
DrvDisablePDEV
DrvEnableSurface
DrvStartDoc
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 108526176 bytes)
DirectDrvDocumentPropertySheets - I was asked for EXTDEVMODE size (which
is 108526168 bytes)
DirectDrvDocumentPropertySheets - I was asked to update my internal
DEVMODE from pdmIn
DrvDocumentEvent
DrvDocumentEvent - RESETDCPOST
DrvDeviceCapabilities - DC_BINADJUST
DrvDeviceCapabilities - DC_ORIENTATION
DrvDocumentEvent
DrvDocumentEvent - STARTPAGE
DrvStartPage
DrvStartPage - Attempt to Create PDF page
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvTextOut
DrvBitBlt
DrvTextOut
DrvTextOut
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvBitBlt
DrvDocumentEvent
DrvDocumentEvent - ENDPAGE
DrvSendPage
DrvSendPage - Attempt to end PDF page
DrvDocumentEvent
DrvDocumentEvent - ENDDOC
DrvEndDoc
DrvEndDoc - Attempting to Save PDF document
DrvDisableSurface
DrvDocumentEvent
DrvDocumentEvent - ENDDOCPOST
DrvDocumentEvent
DrvDocumentEvent - DELETEDC
DrvDisablePDEV


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

xxxxx@hotmail.com wrote:

After removing DrvResetPDEV (which is not needed for my driver b/c most of the objects are automatically cleaned up and not supposed to be copied), I’m now getting DrvBitBlt calls again. Maybe it’s perhaps I have modified some behaviour in DrvDeviceCapabilities callback in the printer interface dll. However, when I tried to debug the printing process, I’m getting an exception thrown at me with the following message:

“Unhandled exception at 0x730068cf in WINWORD.EXE: 0xC0000005: Access violation reading location 0x01999000.”

It appears that now Word is calling DrvBitBlt numerous times (even though that I only have one image in the document. But I’m experiencing an exception thrown at me when I’m in debug mode

Do you know how to use a debugger? This is inside winspool.dll, in
UpdatePrinterDefaults, in a “rep movsd” instruction. My guess is
there’s something inside your DEVMODE that the spooler doesn’t like. If
you run in a debugger, you can catch the breakpoint, and the stack trace
should tell you more.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

The thing is I have encountered the breakpoint as I have mentioned in the post before your reply when I’m debugging the code using Visual Studio debugger attaching to Microsoft Word. When I investigated the call stack, the breakpoint was triggered at winspool.drv. When I ran the printing process with Word attached to windbg, I’m getting the following exceptions, but the debugger lets me proceed with the rest of the process anyway while I’m getting NULL source surface pointer in DrvBitBlt:

(b6c.f58): C++ EH exception - code e06d7363 (first chance)
(b6c.f58): C++ EH exception - code e06d7363 (first chance)
(b6c.fa4): C++ EH exception - code e06d7363 (first chance)

With regards to the DEVMODE structure, does your reply entail that the spooler doesn’t like what I did with respect to my DEVMODE structure in terms of its defaults (UpdatePrinterDefaults)? Anyhow, thanks for pointing this out as a possible source of the crash.

I have managed to isolate the problem being an improper modification of devmode dmPrintQuality and dmYResolution members in the printer interface dll. I have managed to receive some calls to DrvBitBlt for the Word document containing a bitmap, but for some reason, I’m getting NULL clip objects and source surface objects. What could possibly be causing the callback receving NULL source surface object containing the source bitmap to be copied?

I just realized that Word is calling DrvBitBlt for the text box border that is also in the same document, not for the picture in the previous document that I was discussing about when I had my troubles with Word printing images properly. I have also tried out msplot example from Windows Driver Kit and put a breakpoint at DrvBitBlt to see if Word calls DrvBitBlt of the plotter. It appears that DrvBitBlt doesn’t get called properly ever even for the msplot example from DDK. Based on this information, what would be the next best item to look at in order to get MS Word to print images properly?

I would say that DrvBitBlt is getting called properly. Not all raster
ops require a source bitmap.

As a matter of fact, here is the documentation for the psoSrc parameter:

"
psoSrc
Points to a SURFOBJ structure that describes the source for the
bit-block transfer operation, if required by the rop4 parameter.
"

Note the last 6 words. The rest of the documentation is helpful too.

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, August 25, 2008 1:14 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] microsoft word not being able to print images
properly

I just realized that Word is calling DrvBitBlt for the text box border
that is also in the same document, not for the picture in the previous
document that I was discussing about when I had my troubles with Word
printing images properly. I have also tried out msplot example from
Windows Driver Kit and put a breakpoint at DrvBitBlt to see if Word
calls DrvBitBlt of the plotter. It appears that DrvBitBlt doesn’t get
called properly ever even for the msplot example from DDK. Based on this
information, what would be the next best item to look at in order to get
MS Word to print images properly?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

I have noticed that clause on the documentation. I guess I sounded confusing in terms of two different problems. I’m less concerned with DrvBitBlt getting called without a source bitmap b/c of rop4 parameter doesn’t require it. I’m more concerned with printing a document with a single bitmap embedded in the document, but doesn’t even get printed b/c DrvBitBlt never even gets called for both the driver that I’m working on and the msplot example. My question previously really means what probably needs to be done to the driver or even the interface component to get MS Word calling DrvBitBlt properly with a source bitmap (or even other method) to print the image properly. The following is what I have attempted based on the differences on the callbacks being called to print the same image in MS Word and Internet Explorer:

  • getting rid of DrvResetPDEV altogether (b/c it’s not really needed, imo, based on the required functionalities and how the rendering API works on the driver)
  • changing how DrvDeviceCapabilities deals with some of the flags:
  • DC_PAPERSIZE, DC_PAPERS: instead of returning the paper size to the driver as a single constant of the paper size, I have returned whatever is stored in the devmode structure

It would be muchly appreciated to clarify on what’s going on with respect to the additional observations that I have made.