how to print an image using PHP: Printer

后端 未结 3 543
不思量自难忘°
不思量自难忘° 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:23

    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.

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2021-01-14 13:37

    Try having a look at http://www.php.net/manual/en/function.printer-draw-bmp.php and see if that helps...

    0 讨论(0)
提交回复
热议问题