Re: [python-win32] How to change print copies

2020-04-24 Thread Pavel Olifer
and some  interesting things that if i change copies using this
attributes['pDevMode'].Copies = 4
and than
print('Copies= ', win32print.GetPrinter(handle, level)['pDevMode'].Copies)
i see 4 qty. but if i print using

win32api.ShellExecute(
1,
'printto',
path_to_file,
'{}'.format(printer_name),
'.',
0
)

printer printed only 1 copy.

--po

On Fri, Apr 24, 2020 at 8:35 AM Pavel Olifer  wrote:

> Dear Tim,
> "Have you seen a multi-copy setting work using the native driver?" - i
> didn't catch this sentence... did you mean did i use native driver in
> python code?
> All MFP on my job only Konika-Minolta devices.
> -- pavel
>
>
> On Fri, Apr 24, 2020 at 8:11 AM Tim Roberts  wrote:
>
>> On Apr 22, 2020, at 10:10 PM, Pavel Olifer 
>> wrote:
>> >
>> > i use your package for changing  printer settings (duplex, copies).
>> > for duplex it is work, but for copies it doesn’t.
>>
>> Some Windows printers don’t honor the “Copies” selection directly.  The
>> application has to generate multiple copies on its own.  Have you seen a
>> multi-copy setting work using the native driver?
>> —
>> Tim Roberts, t...@probo.com
>> Providenza & Boekelheide, Inc.
>>
>> ___
>> python-win32 mailing list
>> python-win32@python.org
>> https://mail.python.org/mailman/listinfo/python-win32
>>
>
>
> --
> -- po
> +7 (977) 004 67 53
>


-- 
-- po
+7 (977) 004 67 53
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] How to change print copies

2020-04-23 Thread Pavel Olifer
Dear Tim,
"Have you seen a multi-copy setting work using the native driver?" - i
didn't catch this sentence... did you mean did i use native driver in
python code?
All MFP on my job only Konika-Minolta devices.
-- pavel


On Fri, Apr 24, 2020 at 8:11 AM Tim Roberts  wrote:

> On Apr 22, 2020, at 10:10 PM, Pavel Olifer  wrote:
> >
> > i use your package for changing  printer settings (duplex, copies).
> > for duplex it is work, but for copies it doesn’t.
>
> Some Windows printers don’t honor the “Copies” selection directly.  The
> application has to generate multiple copies on its own.  Have you seen a
> multi-copy setting work using the native driver?
> —
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>


-- 
-- po
+7 (977) 004 67 53
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] How to change print copies

2020-04-23 Thread Tim Roberts
On Apr 22, 2020, at 10:10 PM, Pavel Olifer  wrote:
> 
> i use your package for changing  printer settings (duplex, copies).
> for duplex it is work, but for copies it doesn’t.

Some Windows printers don’t honor the “Copies” selection directly.  The 
application has to generate multiple copies on its own.  Have you seen a 
multi-copy setting work using the native driver?
— 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] How to change print copies

2020-04-22 Thread Pavel Olifer
Good day!

i use your package for changing  printer settings (duplex, copies).
for duplex it is work, but for copies it doesn't.

@source_code
def set_duplex(printer_name):
# print_defaults = {"DesiredAccess": win32print.PRINTER_ACCESS_ADMINISTER}
print_defaults = {"DesiredAccess": win32print.PRINTER_ACCESS_USE}
handle = win32print.OpenPrinter(printer_name, print_defaults)

level = 2
attributes = win32print.GetPrinter(handle, level)

print('Printer= ', printer_name)
print('Copies= ', win32print.GetPrinter(handle, level)['pDevMode'].Copies)
print('Duplex= ', win32print.GetPrinter(handle, level)['pDevMode'].Duplex)

# attributes['pDevMode'].Duplex = 1# no flip
attributes['pDevMode'].Duplex = 2# flip up
# attributes['pDevMode'].Duplex = 3  # flip over

attributes['pDevMode'].Copies = 4

#for key in attributes:
#print('{}'.format(key))

#for n in dir(attributes['DevMode']):
#print('{} {}'.format(n, getattr(attributes['DevMode'], n)))

try:
print('try')
win32print.SetPrinter(handle, level, attributes, 0)
print('Copies= ', win32print.GetPrinter(handle, 
level)['pDevMode'].Copies)
print('Duplex= ', win32print.GetPrinter(handle, 
level)['pDevMode'].Duplex)
except Exception as e:
print(e)
win32print.ClosePrinter(handle)


def print_excel(printer_no, path_to_file, duplex='Y', copies=4):
printer_name = app_config.PRINTER_NAMES[printer_no]

if duplex == 'Y':
set_duplex(printer_name=printer_name)

win32api.ShellExecute(
1,
'printto',
path_to_file,
'{}'.format(printer_name),
'.',
0
)

if __name__ == '__main__':
set_duplex(printer_name='server_name\\printer_name')


if i change and then check (just print) properties changed and document printed 
on both sides, but only 1 copy, not 4.
may be you know what did i miss ?

My question on stackoverflow: 
https://stackoverflow.com/questions/58415047/python-win32print-how-to-change-copies
 



-- Pavel

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32