Skip to content

Instantly share code, notes, and snippets.

@beebird
Created July 25, 2018 10:39
Show Gist options
  • Save beebird/9c37adf19a8436ccdd264a9beb09a8d1 to your computer and use it in GitHub Desktop.
Save beebird/9c37adf19a8436ccdd264a9beb09a8d1 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 beebird
#
# Distributed under terms of the MIT license.
"""
"""
import ctypes
mydll = ctypes.windll.LoadLibrary('C:\Documents and Settings\Administrator\Application Data\TSCLIB.dll')
print 'Start Printing.'
mydll.openport("USB003")
mydll.setup("40","30","2","10","0","0","0")
mydll.clearbuffer()
mydll.barcode("10","0","EAN13","80","1","0","2","4","123456789012")
mydll.windowsfont(10,100,50,0,0,0,"Arial","True type font test")
mydll.printlabel("1","1")
mydll.closeport()
# LABEL TEMPLATE
mydll.sendcommand("SIZE 100.0 mm,100.0 mm")
mydll.sendcommand('GAP 3 mm,0 mm')
mydll.sendcommand('DIRECTION 0')
mydll.sendcommand('CLS')
# Draw Label Image
mydll.sendcommand('QRCODE300,300,H,10,A,0,M2,S7,"http:\\www.bfdsfdsfdsaaaaaaaaadfsdafaidu.com\\"')
# Print
mydll.sendcommand('PRINT 1,1')
mydll.closeport()
print 'Finished Printing.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment