diff --git a/README.md b/README.md index 65b9ae9..683091a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Make sure to end with the print page command, signifying the end of a label. printjob.print_page() ### Template Printing -Create your template and upload it to the printer. After creating a BrotherLabel object, call template_mode() to set the printer to template mode, and then use the template commands to fill in your label. +Create your template and upload it to the printer. After creating a BrotherLabel object, call template_mode() to set the printer to template mode, and then use the template commands to fill in your label. Be sure to download the P-Touch Template Tools from support.brother.com under utilities of your label printer. It has a wealth of information. printjob.template_mode() printjob.template_init() @@ -51,5 +51,9 @@ Create your template and upload it to the printer. After creating a BrotherLabel printjob.select_and_insert(, ) printjob.select_and_insert(, ) printjob.select_and_insert(, ) + # For QL-720NW with barcodes on label, turn on: + # printjob.select_priority_print_option('on') printjob.template_print() + + diff --git a/brotherprint/brotherprint.py b/brotherprint/brotherprint.py index 6f0653f..a93bce6 100644 --- a/brotherprint/brotherprint.py +++ b/brotherprint/brotherprint.py @@ -1047,4 +1047,47 @@ def select_and_insert(self, name, data): self.select_obj(name) self.insert_into_obj(data) - + def select_priority_print_option(self, action): + ''' Default is 0 - Priority to print speed. Set to 1 for priority to print quality. + Required for QL-720NW and barcodes. + Args: + action: on or off. + Returns: + None + Raises: + RuntimeError( on or off not selected) + ''' + if action == 'on': + action = '1' + elif action == 'off': + action = '0' + else: + raise RuntimeError('Invalid action for function select_priority_print_option') + self.send('^QS'+action) + + def set_number_of_copies(self, copies): + '''Set the number of copies. Number must be between 1-999 + + Args: + Number of copies + Returns: + None + Raises: + RuntimeError: Invalid number + ''' + try: + # get copies option + copies = int(copies) + except: + raise RuntimeError('Invalid number of copies: ' + str(copies)) + + if copies in range(1,999): + # padded number of copies + copies_pad = '%03d' % copies + # send to printer + self.send('^CN' + copies_pad) + else: + raise RuntimeError('Invalid number of copies. Number must be between 1 and 999') + + +