Convert Image in base64 format to hexadecimal ASCII value - Javascript

I am capturing the signature of the user with a canvas element, this canvas generates an image in base64. Well that signature needs to be printed in a zebra printer, and to achieve that the ZPL language that the printer understands needs the image to be converted to hexadecimal ASCII thing that i can not accomplish.