split big chunk of data to write to printer
This commit is contained in:
17
cmd/main.go
17
cmd/main.go
@@ -9,6 +9,8 @@ import (
|
||||
_ "image/png"
|
||||
)
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"gt.mokkon.com/sainw/libgofunc"
|
||||
)
|
||||
|
||||
@@ -99,11 +101,24 @@ func main() {
|
||||
စက်သုံးဆီ အရေအတွက် နှင့် အရည်အသွေးစျေးနှုန်းများ အားသံသယရှိပါက ph 09450539099, 09765421033, 09765421029 သို့တိုင်ကြား နိုင်ပါသည်။</p>
|
||||
|
||||
`
|
||||
type Data struct {
|
||||
Status string `json:"status"`
|
||||
Result []string `json:"result"`
|
||||
}
|
||||
|
||||
result := libgofunc.GenImg(550, "./", payload, temp, "./")
|
||||
fmt.Println("Result:", result)
|
||||
// PrintImg(C.CString("usb:/dev/usb/lp1"), C.CString("build/out.png"))
|
||||
// libgofunc.Print("int:/dev/bus/usb/001/046", "./out.png")
|
||||
// libgofunc.Print("tcp:192.168.100.110:9100", "./out.png")
|
||||
|
||||
data := Data{}
|
||||
json.Unmarshal([]byte(result), &data)
|
||||
fmt.Println("Data:", data)
|
||||
|
||||
for _, imgPath := range data.Result {
|
||||
fmt.Println("Printing image:", imgPath)
|
||||
libgofunc.Print("tcp:192.168.100.151:9100", imgPath)
|
||||
}
|
||||
// libgofunc.Print("usb:/dev/usb/lp1", "./out.png")
|
||||
// printer := "tcp:192.168.100.151:9100"
|
||||
// ListUSB()
|
||||
|
||||
Reference in New Issue
Block a user