Created
July 25, 2018 10:39
-
-
Save beebird/9c37adf19a8436ccdd264a9beb09a8d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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\\"') | |
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