how to print an image using PHP: Printer

╄→尐↘猪︶ㄣ 提交于 2019-12-30 10:48:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!