Horje
print zpl from java Code Example
print zpl from java
private static boolean printLabel(PrintService printService, String label) {
    if (printService == null || label == null) {
        System.err.println("[Print Label] print service or label is invalid.");
        return false;
    }
    String czas = new SimpleDateFormat("d MMMMM yyyy'r.' HH:mm s's.'").format(new Date());
    String command =  
            "N\n"+
            "A50,50,0,2,2,2,N,\""+label+"\"\n"+
            "B50,100,0,1,2,2,170,B,\""+label+"\"\n"+
            "A50,310,0,3,1,1,N,\""+czas+"\"\n"+
            "P1\n"
            ;
    
    byte[] data;
    data = command.getBytes(StandardCharsets.US_ASCII);
    Doc doc = new SimpleDoc(data, DocFlavor.BYTE_ARRAY.AUTOSENSE, null);
    
    boolean result = false;
    try {
        printService.createPrintJob().print(doc, null);
        result = true;
    } catch (PrintException e) {
        e.printStackTrace();
    }
    return result;
}




Java

Related
how to divide coloumns in a text file into seperate arrays in java Code Example how to divide coloumns in a text file into seperate arrays in java Code Example
torres de hanoi java Code Example torres de hanoi java Code Example
how to spilt the string with comma in jaav Code Example how to spilt the string with comma in jaav Code Example
"https://unpkg.com/thaana-keyboard@2.0.3/dist/ThaanaKeyboard.min.js Code Example "https://unpkg.com/[email protected]/dist/ThaanaKeyboard.min.js Code Example
Java program to print the character or a letter x using star Code Example Java program to print the character or a letter x using star Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7