Open ajayvraikar opened 7 months ago
I generated zpl image command using this library. But its working in Zpl previewer But in actual printer it's not working. Please look into this.
Hello, how are you? At the moment, the library only generates ZPL code. I am planning to implement the print function. You can use another library like react-native-tcp-socket
import TcpSocket from 'react-native-tcp-socket';
import { Zpl } from "react-native-zpl-code";
// Create socket
const options = {
port: 9100,
host: '192.168.0.1', // printer
reuseAddress: true,
};
const client = TcpSocket.createConnection(options, async () => {
// Create a ZPL builder instance
const zplBuilder = new Zpl.Builder();
...
// Generate ZPL code
const zplCode = await zplBuilder.build();
// Write on the socket
client.write(zplCode);
// Close socket
client.destroy();
});
I generated zpl image command using this library. But its working in Zpl previewer But in actual printer it's not working. Please look into this.