how to print an image using PHP: Printer

后端 未结 3 578
不思量自难忘°
不思量自难忘° 2021-01-14 12:42

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?

th

3条回答
  •  醉话见心
    2021-01-14 13:27

    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

提交回复
热议问题