1

我有 Zebra ZM400 (300dpi) 标签打印机,它通过 USB 连接到 Windows PC 上,我已经将这台打印机与\\WindowsIPAddress\\zd.

我的 Java 在Linux Redhat服务器上,我使用Windows Printer via SAMBA方法添加了该打印机。

当我测试打印时,没有标签出来,所以我跟踪了我的程序,但我找不到任何错误,但标签无法打印。

这是我的代码。

OutputStream os = new FileOutputStream("\\\\WindowsIPAddress\zd");

            String commands = "CT~~CD,~CC^~CT~" +
                    "^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ" +
                    "~DG000.GRF,60928,112," +
                    ",::::::::::::::::::::::::N07FpOF8,M0pSFC0,L03FpSF8,L0pUFE,K01FpUF,K07FpUFC0K0IFC0pO03FFE0K0HF80pQ03FE0J01FE0pS0HF0J03FC0pS07F8J03F80pS03F8J07F0pT01FCJ07E0pU0FCJ0FE0pU0FEJ0FC0pU07E:::I01FC0pU07EI01F80pU07E::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::J0F80pU07EJ0FC0pU07E:::J07E0pU0FC:J07F0pT01FCJ03F80pS03F8J03FC0pS07F8J01FE0pS0HF0K0HF80pQ03FE0K0pWFE0K07FpUFC0K01FpUF,L0pUFE,L03FpSF8,M0pSFC0,,::::::::::::::~DG001.GRF,16128,056," +
                    ",:::::::::::gY0AFJFEA0,gX01FLFD0,gW0ABFMFA80,gU057FQFC,gV0IFEFHFEFHFEFA,gS015FUF0,gT02FTFE0,gS05FWF40,gS0YFE0,gR01FXFD0,gR0gGFA,gQ07FgGFC0,gQ0EFEFEFEFEFE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EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEA0,K01FjLF0,L0jLFE0,K05FjLF0,K01FjKFE0,K07FjLF4,K0jNF8,K07FjLF4,K0HFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEAHAEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFAAEFHFEFC,J07FgSFD0105FhFD575FIFD,J03FgSF80H03FhFH8B3FIFE,J07FgSF40H05FhHFH7JFE,J03FgSFJ03FhFAE23FIFE,I017FgSF40H05FhHF53FJF,I01FgTF80H03FhFAF03FIFE,I01FgTF40H05FhHF43FIFE,I02FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEF80H02FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFAEABEFEFE,I07FgTFD5005FhOF,I03FgTFC8003FhNFE,I07FgVFH05FhOF,I03FgUFE003FhNFE,H017FgVFH05FhOF,I0gXFH03FhOF,H017FgVFH05FhOF,H01EFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFHEH02FHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFE,H01FgWFH05FhOF,H01FgWFH03FhOF,H01FgWFH05FhOF,H03FgVFE003FhNFE,H03FUF57FNFD5FNFH05FPFD55FSFH5gF,H03FNF80H03E0H03FLFC00BFMFH03FOF80I0QFA80J083FSFE,H07FNFC0H07D0H07FLFC00FNFH05FOF40H017FOFD4005I57FTF,H03EFEFEFEFE80H0380I0FEFEFEF8003EFEFEFEE002FEFEFEFEFC0J02FEFEFEFEFE80L03EFEFEFEFEFEFEFE,017FNF80H07D0H01FLFD007FMFH05FNFD0I017FOFC0L07FTF,H0BFNF80H030J03FKF8003FMFH03FMFE80K0OFE0M03FSFE,H0PF80N07FKFI01FMFH05FMFC0L07FMF40M07FSFE,H0PF80N02FKFI03FLFE003FMFE0L03FMFO03FSFE,01FOF80J010H01FKFI01FMFH05FMFC0L03FMFI0H5H0157FSFE,H0PFA80N0LF8003FMFH03FMF80M0MFE0H0BE800AFTFE,01FOFD40I050I0LFI01FMFH05FMF80H040I0NFH017F40177FSFE,H0FEFHFEFHFEFE0H02FE0H06FHFEF8003FFEFHFHEH02FHFEFHFE0H02FE0H0HFEFHFEA002FFA007FEFHFEFHFEFHFEFC,01FQFI07FF0H07FJF8003FMFH05FMFI07FD0H0NF017FHF017FTFD,01FPFE0H0IFI03FJF800BFMFH03FLFE0H0HFE8007FKFA00FHFE003FTF8,01FQFH01FHFC007FKF05FNFH05FLFC003FHFC007FKFC017FHF407FTF4,01FPFE0H0IFC003FJFE00FMFE003FLFC002FHF8007FKFA00FIFH03FTF0,01FQFH01FHFC007FVFH05FLFC007FHFC005FKFC01FIF407FTF0,01FPFE003FHFE003FVFH03FLFC003FHFC001FKF800FIF803FSFE0,01FPFE007FHFE007FVFH05FLFC007FHFC005FKFC017FHF407FTF0,H0FEFEFEFEFEFE002EFEE002FEFEFEFEFEFEFEFEE002FEFEFEF8007EFEC0H0FEFEFEA00EFEE002FEFEFEFEFEFEFEE0,01FQFH07FHFE007FVFH05FLFC007FHFC005FKFC017FHF407FTF0,01FPFE003FHFE003FVFH03FLF8007FHFE001FKFA003FFE003FSF80,01FQFH07FHFE007FVFH05FLF4007FHFC005FKFE007FFC007FSF,01FPFE002FHFE003FUFE003FLFI07FHFE001FKFA002FFA003FSF,01FQFH07FIFH07FVFH05FLF4007FHFD005FLFH015D0017FSF,01FPFE003FHFE003FVFH03FLF8007FHFE001FKFE0M0TFE,01FPFE007FHFE007FVFH05FLF4007FHFC005FLF40K017FRFE,01FEFHFEFHFEFE003FFEE002FHFEFHFEFHFEFHFHEH02FHFEFHF8007EFFC001FEFHFEF80K03FFEFHFEFHFEFHF8,01FQF017FHFC007FVFH05FLF4007FHFC005FLF40K01FSF9,01FPFE003FHFC007FVFH03FLF8007FHFC001FLFE0K03FSF0,01FQFH07FHF4007FVFH05FLFC007FHFC005FMFC0I057FRFC0,01FPFE002FHF8007FUFE003FLFC003FHF8003FMF80I02FSF80,01FQFH07FHFI0LFD57FNFH05FLFC003FHFC007FMFC05H5UF80,H0QFE003FFE0H0LF800FNFH03FLFC0H0HFE800FMFE80BAFTFC,01FPFE007FFE0H0LFC01FNFH05FLFC001FHFI07FMFH07FUFC,H0FEFEFEFEFEFE002EF8002EFEFEF800FEFEFEFEE0H0FEFEFEFE0H02FE0H0EFEFEFEF802FEFEFEFEFEFEFEFEE8,01FQFH07FF9001FKF801FNFH05FMFI07FD0H0NFD01FVF0,H0BFOFE0I080H03FKFI03FKFE80H0BFKFE80H080I0NF800FUF80,H07FPFN07FKFI03FKFE0I01FLFC0L07FMF400557FRF,H0BFOFE0M07FJFE0H03FKFE0I01FLF80L03FLFE0H0H2AFQFE,H07FPFM01FLFI01FKFE0I01FLFC0L07FMFK0I5QF,H0BFOFE0M0MFI03FKFE0I01FLF80L07FLFE0L0BFOFE,H07FOFE0L07FLFI01FKFE0I01FLFE0L0OF40K017FOF,H03EFHFEFHFEFE0L07FEFHFEF8001FFEFHFE0I01FFEFHFEF80J02FHFEFHFEF80L02FEFHFEFHFE,H03FPFL017FLFD001FLFJ01FMFD0J07FNFD0L01FOF,H03FOFE0K0BFMFC001FKFE0I03FNF80H03FOFE80L0OFE,H01FPFH01557FNFD001FgGFI5RFN07FNF,H01FOFE002003FNFE003FLFHAEABFNFE002FPFE0M07FMFE,H01FPFH03FRFH01FgUF401510I07FNF,H01FOFE003FRFH03FgUF80280J03FMFE,H017FNFE003FRFH03FgUF417FF74007FNF,I06FEFEFEFEFE003EFEFEFEFEFEFE003EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE800EFEFA003EFEFEFEFE,H017FOFH03FRFH07FgTFC01FIFD017FNFQ0I1,I03FNFE003FQFC00BFgTF803FIFE003FMFE0Q0BFE8,I07FOFH07FQFC00FgUFH01FIFE007FNFQ07FIF40,I03FNFE003FQF800FgUF803FIFE007FMFE0P03FHFE,I01FOFH03FQF801FgUFH01FIFD017FNFP01FKF0,I01FNFE003FQF800FgUF800FIFA00FNFE0P0KFE0,I01FNFE001FQFH05FgUFH017FHF400FOFP07FKF4,J07FFEFHFHEJ03FEFHFEFHFEC006FHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFE80022A0H02FEFHFEFHFE0O0FEFHFEFE,I017FMF10H03FOFD007FgUF80015D5001FOFO01FMF,J03FLFE0I03FOFE00FgVFA0M03FNFE0N01FLFE,J07FLFE0I03FPF87FgWFM017FNFE0N07FMF40,J03FLFE0I03FPF83FgVFE0M07FNFE0N07FMF80,J01FMFJ03FPFDFgXF40K05FOFE0M01FNFC0,K0MFE0I03FPF8FgXF80K03FOFE0N0OFC0,K07FLFJ07FhQF40I057FOFC0M01FNFE0,K02FEFEFEFAJAFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEEA002AFEFEFEFEFEFC0M03EFEFEFEFEE0,K07FLFDFDFhTFJ5RFD0M07FOF0,K01FjFC0M03FNFE8,L0jGFC0M07FOFC,L0jGFC0M03FOF8,L07FiYFC0L017FOFC,L07FiYF80M07FOF8,L05FiYF40L017FOFC,M0EFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFFE0N07FFEFHFEFHFC,L01FiYFN017FOFC,M03FiWFE0N0QFC,M01FiXFN017FOFC,N0iXFE0N0QFC,N07FiWFN017FOFC,N0BFiVFA0N0QFC,N01FiVFC0M017FOFC,O02FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE80N07EFEFEFEFEFC,N017FiUF80M017FOFC,P0iVF80N03FOF8,O017FiTFP07FOFC,P02FiTFP03FNFE8,P017FiSFP07FOF8,Q02FiRFE0O03FNFE8,R07FiQFE0O03FNFE0,S02FEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEF80P0HFEFHFEFFE0,Q0H15FiPFD0O01FNFC0,U0ABBAA0FiIF80P0OFC0,T0H57FF55FiIF80P07FMFC0,gG03FiHFR03FMF,gG07FiGFD0Q01FMF,gG03FiGFE0Q01FLFE,gG01FiGFC0R07FKFC,gH07EFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE80R03EFEFEE0,gG017FiFC0R05FKF4,gH03FiF80S0BFIFA0,gH07FiFT01FJFC0,gH02FhYFE0U0BFF8,gH01FhYFD0U01550,gI0iF80V0A80,gI07FhXFC,gI02FHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFHFEFFE0,gI03FhXF0,gJ0hXFC0,:gJ03FhVF,gJ01FhVF,gK0hVFE,gK07FhTFC,gL0FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEE0,gK05FhTF0,gL0BFhRFA0,gK01FhSFC0,gL03FhRF,gL017FhQF,gM0hRFA,gM07FgOF7FYF0,gN07FFEFHFEFHFEFHFEFHFEFHFEFHFEFC0EFHFEFHFEFHFEFHFEFF80,gM017FgMFD1FXFD0,gN02FgLFE003FVFE,gN07FgMFH07FWF,gO03FgKF80H03FTFE8,gO01FgKFJ01FTFD0,gO02FgJFA0J0UF80,gP05FgIFL05FRFC,gP03EFEFEFEFEFEFEFEFEFEFEFEE0L0BEFEFEFEFEFEF8,gP017FgGFD0K0H1QFD0,gR0gGF80O0BFMF8,gQ01FgFD0N017FMF4,gS0YFE0R0AFHFE8,gR0H1WFD0S0I1010,gT0WFA,gT05FTFD0,gU0EFHFEFHFEFHFEFFE0,gU017FQFD,gX0BFLFEA80,gW057FMFD40,gY02AFHFEA80,,::::::::::::::::::::::::::^XA" +
                    "^MMT" +
                    "^PW976" +
                    "^LL1126" +
                    "^LS0" +
                    "^FT482,122^A0N,58,57^FH\\^FD" + orderCode + "^FS" +
                    "^FT137,312^A0N,58,57^FH\\^FD" + voShippingInfo.get("CUSTOMER_NAME") + "^FS" +
                    "^FT137,399^A0N,42,40^FH\\^FD" + Address + "^FS" +
                    "^FT329,477^A0N,42,40^FH\\^FD" + postal_code + "^FS" +
                    "^FT32,544^XG000.GRF,1,1^FS" +
                    "^FT64,1088^XG001.GRF,1,1^FS" +
                    "^FT137,125^A0N,63,62^FH\\^FDOrder Code^FS" +
                    "^FT137,222^A0N,58,62^FH\\^FDDeliver to:^FS" +
                    "^FT61,747^A0N,42,40^FH\\^FDProudly brought to you by^FS" +
                    "^FT137,476^A0N,42,40^FH\\^FDCountry^FS" +
                    "^PQ1,0,1,Y^XZ" +
                    "^XA^ID000.GRF^FS^XZ" +
                    "^XA^ID001.GRF^FS^XZ";

            os.write(commands.getBytes());
            os.close();

我从 Windows 上的 localhost 尝试过,但是当我从 Linux Server 测试时,没有任何结果。

任何帮助表示赞赏。

4

0 回答 0