•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,489 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,731 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 27637 | Replies: 14
![]() |
•
•
•
•
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.
can you elaborate a bit more of the how to lineprint to copy to lpt port ? pardon me for my ignorance.
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: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 19
Solved Threads: 200
•
•
Join Date: Dec 2006
Posts: 2
Reputation:
Rep Power: 0
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.
Visual basic can produce activex programs
•
•
Join Date: Oct 2008
Posts: 23
Reputation:
Rep Power: 1
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the PHP Forum
- Previous Thread: optional variables in php functions
- Next Thread: Restricting access to list & detail pages



Linear Mode