How to align elements in win32ui, win32print

1

Good afternoon I have the following code to print an image in this case:

import sys
import win32print
import win32ui
from PIL import Image, ImageWin

printer = win32print.EnumPrinters(2)
for prin in printer:
    print(prin[2])

PHYSICALHEIGHT = 0
PHYSICALWIDTH = 0
imagen = "av.jpg"

hDC = win32ui.CreateDC()
hDC.CreatePrinterDC("EC-PM-5890X")
printer_size = hDC.GetDeviceCaps(PHYSICALWIDTH),hDC.GetDeviceCaps(PHYSICALHEIGHT)

bmp = Image.open(imagen)
if bmp.size[0] < bmp.size[1]:
    bmp = bmp.rotate(90)

hDC.StartDoc("jkhfhdfdfh")
hDC.StartPage()
dibuja = ImageWin.Dib(bmp)
dibuja.draw(hDC.GetHandleOutput(),(200,20,150,50))

hDC.EndPage()
hDC.EndDoc()

the problem is that when I try to send the image more to the center dibuja.draw(hDC.GetHandleOutput(),(200,20,150,150)) the image becomes smaller

    
asked by Revsky01 31.08.2018 в 20:59
source

0 answers