开发者

PHP Print code (print into paper)

开发者 https://www.devze.com 2023-01-10 08:50 出处:网络
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

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

精彩评论

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