[python-win32] "Hebrew transformation" when printing with SetGraphicsMode(GM_ADVANCED)

Luc Saffre luc.saffre at gmx.net
Fri Sep 23 16:27:49 CEST 2005


Hello,

here is a script that prints a simple text to the Windows default
printer. But on some printers, each letter is mirrored around its
baseline (upside down, but left stays left). I call this effect "Hebrew
transformation" because to me the result looked at first glance like
hebrew text.

The problem occurs for example on a Brother MFC-3520C (an ink jet
printer). Funnily it never occurs on a Samsung ML-1200 (laser). It also
never occurs if I use a redirected "Lexmark Optra PS" driver and watch
the result using GhostView. It must have to do with advanced graphics
mode because it also disappears on the Brother if I remove the line
dc.SetGraphicsMode(win32con.GM_ADVANCED)

(This script does not need GM_ADVANCED mode, but in other scripts I want
to use SetWorldTransform() which requires GM_ADVANCED)

Any hints or ideas?

I'd also be glad to get some test reports on other printers.

Luc

Here is the code:

-------
import win32ui
import win32con

dc = win32ui.CreateDC()
dc.CreatePrinterDC()
dc.StartDoc("test")
dc.SetGraphicsMode(win32con.GM_ADVANCED)
dc.SetMapMode(win32con.MM_TWIPS)
dc.StartPage()
font = win32ui.CreateFont({'name':"Courier New"})
dc.SelectObject(font)
dc.TextOut(800,-800,"This is a test")
dc.EndPage()
-------



More information about the Python-win32 mailing list