以下为java方式实现条码打印,供参考,一般可用于本地调试。
1、js和applet的实现方式见另一篇文章。
2、TSC applet和js打印测试包(包含打印机驱动、打印插件、applet和js调试代码),https://www.xinac.com/article/223.html
3、有问题请尽量发邮件,10513276@qq.com
import java.io.UnsupportedEncodingException;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.Native;
public class TscMain {
public interface TscLibDll extends StdCallLibrary {
TscLibDll INSTANCE = (TscLibDll) Native.loadLibrary("TSCLIB", TscLibDll.class);
int about();
int openport(String pirnterName);
int closeport();
int sendcommand(String printerCommand);
int setup(String width, String height, String speed, String density, String sensor, String vertical, String offset);
int downloadpcx(String filename, String i