开发者

PHP Print code (print into paper)

Is there a PHP function to print something from a web page (inside the browser)?

I was searching in Google but the resul开发者_JAVA技巧t is the print() function. Or any ideas, or any web programming language that you can share. I need a code to print a list of subjects from my database. Sorry for this stupid question. I don't know if that is possible.


If you are talking about a web application, you can bring up the print dialog box with JavaScript using the window.print() function.

Without using activex or other such trickery, there is no way to automatically send something to the printer.

This is a good thing, imagine a malicious web site printing thousands of pages on your machine without your consent.

If you are running a command line php that will depend on the operating system.


If the intention is a print preview, where the user can click an “Print this” button and the server will print the document you can use CUPS if you use a Linux/Apple/BSD server. http://www.cups.org/articles.php?L545+TNews+Q


try this, you need to add php_printer.dll, then enable that extension (after restarting apache) http://in2.php.net/manual/en/function.printer-write.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜