• 大小: 1.18MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-27
  • 语言: Java
  • 标签: TSC  JAVA  二次开发  

资源简介

TSC条码打印机-JAVA调用范例,供二次开发的朋友参考。

资源截图

代码片段和文件信息

package dlltest;
import com.sun.jna.Library;
import com.sun.jna.Native;
public class Main {
    public interface TscLibDll extends Library {
        TscLibDll INSTANCE = (TscLibDll) Native.loadLibrary (“TSCLIB“ TscLibDll.class);
        int about ();
        int openport (String pirnterName);
        int closeport ();
        int sendcommand (String printerCommand);
        int setup (String widthString heightString speedString densityString sensorString verticalString offset);
        int downloadpcx (String filenameString image_name);
        int barcode (String xString yString typeString heightString readableString rotationString narrowString wideString code);
        int printerfont (String xString yString fonttypeString rotationString xmulString ymulString text);
        int clearbuffer ();
        int printlabel (String set String copy);
        int formfeed ();
        int nobackfeed ();
        int windowsfont (int x int y int fontheight int rotation int fontstyle int fontunderline String szFaceName String content);
    }

    public static void main(String[] args) {
        //TscLibDll.INSTANCE.about();
        TscLibDll.INSTANCE.openport(“TSC TTP-2410M“);
        //TscLibDll.INSTANCE.downloadpcx(“C:\\UL.PCX“ “UL.PCX“);
        TscLibDll.INSTANCE.sendcommand(“REM ***** This is a test by JAVA. *****“);
        TscLibDll.INSTANCE.setup(“100“ “100“ “5“ “8“ “0“ “0“ “0“);
        TscLibDll.INSTANCE.clearbuffer();
        //TscLibDll.INSTANCE.sendcommand(“PUTPCX 55010\“UL.PCX\““);
        TscLibDll.INSTANCE.printerfont (“100“ “10“ “3“ “0“ “1“ “1“ “(JAVA) DLL Test!!“);
        TscLibDll.INSTANCE.barcode(“100“ “40“ “128“ “50“ “1“ “0“ “2“ “2“ “123456789“);
        TscLibDll.INSTANCE.windowsfont(400 200 48 0 3 1 “arial“ “DEG 0“);
        TscLibDll.INSTANCE.windowsfont(400 200 48 90 3 1 “arial“ “DEG 90“);
        TscLibDll.INSTANCE.windowsfont(400 200 48 180 3 1 “arial“ “DEG 180“);
        TscLibDll.INSTANCE.windowsfont(400 200 48 270 3 1 “arial“ “DEG 270“);
        TscLibDll.INSTANCE.printlabel(“1“ “1“);
        TscLibDll.INSTANCE.closeport();
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-05-04 14:09  TscLibDllTestInJave\
     目录           0  2010-05-04 10:02  TscLibDllTestInJave\build\
     目录           0  2010-05-04 10:02  TscLibDllTestInJave\build\classes\
     文件           0  2010-05-04 10:02  TscLibDllTestInJave\build\classes\.netbeans_automatic_build
     目录           0  2010-05-04 14:01  TscLibDllTestInJave\build\classes\dlltest\
     文件        1614  2010-05-04 14:01  TscLibDllTestInJave\build\classes\dlltest\Main$TscLibDll.class
     文件        1635  2010-05-04 14:01  TscLibDllTestInJave\build\classes\dlltest\Main.class
     文件        3716  2010-05-04 10:02  TscLibDllTestInJave\build.xml
     目录           0  2010-05-04 13:09  TscLibDllTestInJave\dist\
     目录           0  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\
     文件         906  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\allclasses-frame.html
     文件         866  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\allclasses-noframe.html
     文件        5183  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\constant-values.html
     文件        5119  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\deprecated-list.html
     目录           0  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\
     目录           0  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\class-use\
     文件        5452  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\class-use\Main.html
     文件        6748  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\class-use\Main.TscLibDll.html
     文件        9916  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\Main.html
     文件       20091  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\Main.TscLibDll.html
     文件        1193  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\package-frame.html
     文件        6091  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\package-summary.html
     文件        5550  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\package-tree.html
     文件        5825  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\dlltest\package-use.html
     文件        9551  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\help-doc.html
     目录           0  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\
     文件        6086  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\index-1.html
     文件        6614  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\index-10.html
     文件        6580  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\index-11.html
     文件        6212  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\index-12.html
     文件        6388  2010-05-04 13:09  TscLibDllTestInJave\dist\javadoc\index-files\index-2.html
............此处省略31个文件信息

评论

共有 条评论