User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Sep 2004
Posts: 24
Reputation: chunguy is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
chunguy's Avatar
chunguy chunguy is offline Offline
Newbie Poster

Re: How To Print Directly to Printer

  #11  
Feb 7th, 2005
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
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How To Print Directly to Printer

  #12  
Feb 7th, 2005
Say after me: you can not access hardware on the client machine from a serverside application or script.

You CAN print from your serverside application to any printer which is attached to the server (if PHP supports that...), but never to the client.
Reply With Quote  
Join Date: Apr 2005
Posts: 1
Reputation: gmalcolm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gmalcolm gmalcolm is offline Offline
Newbie Poster

Re: How To Print Directly to Printer

  #13  
Apr 27th, 2005
Oh yes you can...

Of course PHP can print to a printer linked to the server. It's called an intranet! Most PHP is coded as internal utilities within companies... not on external websites. Try the PECL php_printer.dll install and then use the print functions. On Unix just do a system('lpr')...
Reply With Quote  
Join Date: Dec 2006
Posts: 2
Reputation: stoopidnerd is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
stoopidnerd stoopidnerd is offline Offline
Newbie Poster

Re: How To Print Directly to Printer

  #14  
Dec 28th, 2006
Originally Posted by cscgal View Post
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
Reply With Quote  
Join Date: Oct 2008
Posts: 23
Reputation: psycho007 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
psycho007 psycho007 is offline Offline
Newbie Poster

Re: How To Print Directly to Printer

  #15  
19 Days Ago
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
  1. <?php
  2. phpinfo();
  3. ?>

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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC