如何从javascript或PHP通过打印机IP在Zebra ZM400上打印?

I know there are some almost similar threads, but none is the same and none has helped me. I have to print tickets with Zebra ZM400 printer but I did not managed to do this in the last two days. Since I didnt find clear and working solutions on the net, I hope you guys can give me a solution. I have tried two methods:

  1. jZebra: I've set the printer name then pressed print, but I always get the error: "Printer does not accept job". Did not get any solution for it. And I think this would be a printover USB and not IP, since I could not find any setting to adjust the printer's IP address.
  2. I've tried to print with the following class, but nothing happens even when trying the sample code: http://www.phpclasses.org/package/2540-PHP-Abstraction-for-printing-documents.html . I get PHP timeout error. Can't even find the printer.

Any advice is welcome. Thanks you!