Hello guys,
I'm making a barcode-system, for my stock. Making the barcode is working fine, but now I need to print it. The last thing I do is:
but how can I send this file directly to my printer. There is a function called 'printer_draw_bmp' that 'll do this. But my file is jpeg (or png, or something else, but not .bmp). Isn't there a function that will do the same like imagejpeg but to bmp?
I tried to convert the jpeg with the 'jpeg2wbmp' to bmp but that didn't work. Anyone an idea?
this is how I do it, but it isn't working...
The One And Only KryptoS
I'm making a barcode-system, for my stock. Making the barcode is working fine, but now I need to print it. The last thing I do is:
Code:
imagejpeg($this->im,$this->filename,$quality);
but how can I send this file directly to my printer. There is a function called 'printer_draw_bmp' that 'll do this. But my file is jpeg (or png, or something else, but not .bmp). Isn't there a function that will do the same like imagejpeg but to bmp?
I tried to convert the jpeg with the 'jpeg2wbmp' to bmp but that didn't work. Anyone an idea?
this is how I do it, but it isn't working...
Code:
// $_POST has my printer
$handle = printer_open($_POST['Printers']);
// get image height, width
list($width, $height, $type, $attr) = getimagesize("tmp/barcode/test.jpeg");
// jpeg to bmp? Something goes wrong here
jpeg2wbmp("tmp/barcode/test.jpeg","tmp/barcode/test.bmp",$height,$width,0);
// print bmp...
printer_draw_bmp($handle,"tmp/barcode/test.bmp",0,0,$width,$height);
printer_close($handle);
The One And Only KryptoS