printing a dot matrix image through Javascript or PHP using zebra GC420t


we are developing a desktop based real time application using php and javascript where we take the details of a particular person and print the image of the person. When i tried to print the image of the person it prints the black box.

I want to use the zebra driver not the windows driver. So when the i click the print button it should print through the zebra printer without showing the preview of the print sheet as the windows driver

The first attachment consist of javascript which has parameters passing to the printer(DevDemo.js)

And the second attachment which converts the png image to grf(zpl.php)

I need to print the below image

1542169259154 - Copy.JPEG

but I am getting this image


please look at the code and provide the solution

Thanks in advance...