I think that not the very good idea , printer never understand any file format they understand drivers language , c if you can create a print.prn file with the printer driver and then run this simple command on root prompt ,
>> copy printer.prn > lpt1
it will send file to printer , usually on websites , every one just calls
window.print.open
javascript rest end user will select the printer and print the html page