Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ Make sure to end with the print page command, signifying the end of a label.
printjob.print_page(<cut_setting>)

### 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()
printjob.choose_template(<template_number>)
printjob.select_and_insert(<field_name>, <data>)
printjob.select_and_insert(<field_name2>, <data2>)
printjob.select_and_insert(<field_name3>, <data3>)
# For QL-720NW with barcodes on label, turn on:
# printjob.select_priority_print_option('on')
printjob.template_print()



45 changes: 44 additions & 1 deletion brotherprint/brotherprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')