Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CreateDC w/ StartDoc vs OpenPrinter w/ StartDocPrinter while using DEVMODE

183 views
Skip to first unread message

HERE@gfnet.com Todd R. Jacobs

unread,
Oct 1, 2009, 1:46:10 PM10/1/09
to
Hi,

I am trying to send raw data ( a .prn file) to our networked printers. I can
set the dmPaperSize, dmPaperWidth, dmPaperLength, and dmCopies members of
the pDevMode structure with three calls to DocumentProperties with the last
using DM_IN_BUFFER | DM_OUT_BUFFER

Using CreateDC with the pDevMode and send data using StartDoc, Escape
PASSTHROUGH, EndDoc and it will use my custom pDevMode values, but print a
undesirable extra blank page after each document so I really can't use this
method.

Or I can send the same raw data using OpenPrinter with a PRINTER_DEFAULTS
that uses the same pDevMode structure via StartDocPrinter, WritePrinter,
EndDocPrinter that does not print the extra blank page, but does not use the
custom pDevMode values, it uses the default printer values, so I can't use
this method either.

The complete file comes out at the printer with either method, but because
of the issues I listed I can't user either method.

Does anyone know how to solve either of the above issues?

1. Eliminate the trailing blank page using the DC method, or

2. Have OpenPrinter use custom devmode values.

Thanks,

Todd


HERE@gfnet.com Todd R. Jacobs

unread,
Oct 2, 2009, 10:09:54 AM10/2/09
to
One note with the OpenPrinter method and PRINTER_DEFAULTS, if I use
PRINTER_ALL_ACCESS I get "Access is denied" so I use PRINTER_ACCESS_USE.
Would this be a reason for the pDevMode not to be used.

Thanks again,
Todd

"Todd R. Jacobs" <tjacobs@NOT HE...@gfnet.com> wrote in message
news:eHjFQ8r...@TK2MSFTNGP02.phx.gbl...

0 new messages