使用PHP为打印机编码 [英] Coding for the printer using PHP

查看:120
本文介绍了使用PHP为打印机编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是PHP的新手,我希望能够为打印机编写代码.
希望能够从数据库也可以从我的网页和其他页面打印.

Am new to PHP and i want to be able to code for the printer.
Want to be able to Print form my web page and others also from the database.

推荐答案

PHP不直接与打印机交互.您可以选择使用一个库来创建提供最多控制权的供下载的PDF,或者使用css为打印机html页面创建样式表,但是对于打印css,您将无权控制页眉和页脚.在浏览器中成为客户端.

如果您选择使用PDF路线,则PHP的最佳pdf库可能是fpdf,可从此处免费下载 http://www.fpdf.org / [^ ]

如果要走CSS路线,则需要为印刷媒体类型创建样式表,以在此处 http://www.w3schools.com/css/css_mediatypes.asp [ ^ ]

希望有帮助.
PHP does not directly interact with printers. Your options are to use a library to create a PDF for download which offers the most control or to use css to create a stylesheet for printer html pages, however in the case of print css you will not have control over headers and footers as that will be client side in the browser.

If you opt to go the PDF route the best pdf library for PHP is probably fpdf which is a free download from here http://www.fpdf.org/[^]

If you want to go the css route then you need to create a stylesheet for the print media type to find out more about that hit w3schools here http://www.w3schools.com/css/css_mediatypes.asp[^]

Hope that helps.


这篇关于使用PHP为打印机编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆