[python-win32] printing landscape in Windows

Todd Fiske toddfiske at gmail.com
Thu Jun 11 06:20:52 CEST 2015


It seems I'm wrong about just needing a little adjustment. When you use
WritePrinter, you are sending raw bytes to the printer, thanks to opening
the device in "RAW" mode. In this mode, you would need to send the actual
printer escape code that sets it to Landscape, in the language of its
default driver which may be PCL or XPS, or may be something proprietary.

In contrast, MSWinPrint creates a printer device context (dc) and draws to
it with GDI commands, which is a more flexible device-independent method.

Apologies for the false lead, I should have tested it first.

On Wed, Jun 10, 2015 at 6:43 PM, Todd Fiske <toddfiske at gmail.com> wrote:

>
> On Wed, Jun 10, 2015 at 2:48 PM, Hans Becker <hjb2 at earthlink.net> wrote:
>
>>   Does anyone by chance have sample code I could cut and paste to print
>> landscape?
>>
>
> I don't have a cut and paste example on hand, but you might benefit from
> reading the source of this module, or even using it:
>
>     MSWinPrint 1.1 : Python Package Index
>     https://pypi.python.org/pypi/MSWinPrint
>
> The method they show for setting landscape mode (setting
> devmode.Orientation) looks like it will blend in with what you have with
> only a little adjustment.
>
> Todd
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20150611/16876475/attachment.html>


More information about the python-win32 mailing list