File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1065,4 +1065,29 @@ def select_priority_print_option(self, action):
10651065 raise RuntimeError ('Invalid action for function select_priority_print_option' )
10661066 self .send ('^QS' + action )
10671067
1068+ def set_number_of_copies (self , copies ):
1069+ '''Set the number of copies. Number must be between 1-999
1070+
1071+ Args:
1072+ Number of copies
1073+ Returns:
1074+ None
1075+ Raises:
1076+ RuntimeError: Invalid number
1077+ '''
1078+ try :
1079+ # get copies option
1080+ copies = int (copies )
1081+ except :
1082+ raise RuntimeError ('Invalid number of copies: ' + str (copies ))
1083+
1084+ if copies in range (1 ,999 ):
1085+ # padded number of copies
1086+ copies_pad = '%03d' % copies
1087+ # send to printer
1088+ self .send ('^CN' + copies_pad )
1089+ else :
1090+ raise RuntimeError ('Invalid number of copies. Number must be between 1 and 999' )
1091+
1092+
10681093
You can’t perform that action at this time.
0 commit comments