McPacino wrote:
I have a network printer. the default paper size is A4.
I have tried 2 ways to change the paper size:

1)
p = win32print.OpenPrinter(dp)
t = win32print.GetPrinter(p, 2)
t['pDevMode'].FormName=u'a3'
win32print.SetPrinter(p, 2, t, 0)

these code cause error refuse access, which maybe because of it's network
printer


The default access for OpenPrinter isn't enough to set the form. Try
win32print.OpenPrinter(dp, {'DesiredAccess':win32print.PRINTER_ALL_ACCESS})

       Roger

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to