你好,我把這段代碼有:如何打印的圖像用PHP
$handle = printer_open ("HP Photosmart 5520 series");
printer_write ($handle, "jo.png");
printer_close ($handle);
而不是打印,打印文本我的jo.png圖像但是。
你好,我把這段代碼有:如何打印的圖像用PHP
$handle = printer_open ("HP Photosmart 5520 series");
printer_write ($handle, "jo.png");
printer_close ($handle);
而不是打印,打印文本我的jo.png圖像但是。
試一下printer-draw-bmp在本手冊的評論中有很好的例子。
$im = imagecreatefrompng('kitten.png');
$randomName = uniqid() . '.bmp';
imagewbmp($im, $randomName);
$handle = printer_open("HP Photosmart 5520 series");
printer_start_doc($handle, "My Document");
printer_start_page($handle);
printer_draw_bmp($handle, $randomName, 0, 0);
printer_end_page($handle);
printer_end_doc($handle);
printer_close ($handle);
unlink($randomName);
[字符串$內容](http://www.php.net/manual/en/function.printer-write.php) – AD7six
是的,我看到,但如何把一個圖片,而不是文字 – djodev