[python-win32] win32print pDevMode change DriverData

Tim Roberts timr at probo.com
Mon Nov 24 07:21:15 CET 2014


On Nov 21, 2014, at 1:39 AM, Benjamin Kötting <benjamin.koetting at inetvalue.com<mailto:benjamin.koetting at inetvalue.com>> wrote:

If I iterate over the pDevMode I see this options in DriverData binary string, first I try to make a binary replace in DriverData without success 2 more bytes are changed.

OVERCOATTYPE OPTYPE_LUSTER

If I will overwrite the whole DriverData with the data when the printer was set to matte using the windows dialog It works, so I have saved me the content and can load it into DriverData if needed.

But I think it is a very dirty way to do, even I doesn't know which special features will follow in the future.

Sadly, there really is no other way to do it.  Windows tries its best to provide an abstraction for the devices at the bottom of things.  With some classes of devices, the abstraction works well.  With other classes, it doesn’t.  Printing is one class of devices where it doesn’t work.  Anything special features that weren’t anticipated in the abstraction aren’t available except through escapes and overrides, like what you are using.
--
Tim Roberts, timr at probo.com<mailto:timr at probo.com>
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20141123/8566b28a/attachment.html>


More information about the python-win32 mailing list