| | |
How To Print Directly to Printer
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
Originally Posted by xiaolee
I guess the very first issue here is, PHP will be installed in your server. And there might be 2 issue, one is using WIN OS, and the other might be unix based os.
I know you can make use of LINUX command in PHP to trigger the printing. You can alos use normal DOS COMMANF in PHP if you are running WIN OS. It is simply the lineprint command or copy to lpt port. but I wouldn't know how can you track with the NETWORK Printer is ready, and able to print. Hope this does help. regarding the phpprinter command, it is only able to run in WINDOWS environment.
btw, POA i'm running win XP, it seems that the functions listed there does not support win xp... although someone posted on the user contribution that it can actually be used on XP too. tried email-ing the person but to no response. http://my.php.net/manual/en/ref.printer.php
•
•
Join Date: Dec 2006
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
I don't believe this is possible as PHP is a scripting language, and therefore doesn't have the ability to gain control of hardware directly. For example, you wouldn't be very happy if you were surfing the web and various PHP-driven sites had direct access to your hard drive and hardware! What you're looking for should be possible through ActiveX controls. ActiveX controls are mini-programs (??) that are downloaded automatically over the Internet ... such as the way that the Windows Update website has control to install software to your hard drive automatically. Not sure how they work though ... that's a Microsoft thing.
•
•
Join Date: Oct 2008
Posts: 23
Reputation:
Solved Threads: 0
you can print directly to a printer held on the clients machine. the php_printer.dll is needed which can be found in the PECL downloads.
once you have downloaded and copyed the php_printer.dll into your extensions folder i.e. c:\php\ext edit the php.inin in c:\php\ and add a line extension=php_printer.dll line in the extensions section, re start iis or apache webserver.
Check that the php extensions has loaded by creating a info.php file containing
scroll down for printer settings this will determine that the extensions is initialised correctly
Then on the php.net website do a search for printer_set_option for printer function and you will see all the printer fuctions that php has to offer.
once you have downloaded and copyed the php_printer.dll into your extensions folder i.e. c:\php\ext edit the php.inin in c:\php\ and add a line extension=php_printer.dll line in the extensions section, re start iis or apache webserver.
Check that the php extensions has loaded by creating a info.php file containing
php Syntax (Toggle Plain Text)
<?php phpinfo(); ?>
scroll down for printer settings this will determine that the extensions is initialised correctly
Then on the php.net website do a search for printer_set_option for printer function and you will see all the printer fuctions that php has to offer.
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: How to store files for a Content Management System (CMS)
- Next Thread: Broken query string in PHP
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop open parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update upload url validation validator variable video web xml youtube






