问题
I have a printer directly attached to my PC and i am able to print texts using PHP. what I want to know is, how can I print an image using the same php functions?
thanks
回答1:
Try having a look at http://www.php.net/manual/en/function.printer-draw-bmp.php and see if that helps...
回答2:
Check the documentation from: http://www.php.net/manual/en/book.printer.php
But I don't see anything for printing image files in the documentation.
回答3:
You should convert the image to a bitmap file (.bmp).
You can then draw it using the function found here: http://www.php.net/manual/en/function.printer-draw-bmp.php
another option is to write d image into a pdf/postscript file and put into printer_write("filename.pdf").
You could also just copy the image to the spool folder.
Printing with PHP is really cool tho :D
来源:https://stackoverflow.com/questions/6227460/how-to-print-an-image-using-php-printer