Unix Programming - Printing through PHP on a UNIX system

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2005 > Printing through PHP on a UNIX system





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Printing through PHP on a UNIX system
cbennett@napanet.net

2005-09-21, 8:49 pm

Hello, I'm a *novice* at both using php and UNIX, and came across a
problem while trying to modify an ex-coworkers php code for printing.

The original script sent one huge print job to our printing server,
which worked fine since we weren't printing duplex. We'd like to now
split the jobs up and send them individually, which we easily achieved
using a while loop to send each job.

The problem is that since the printer is in duplex mode now, if you
have two jobs which are 1 sheet each they will print them each on one
side of the paper. Obviously not a good thing for two seperate bills.

My question is that since we're using the system command lp to print
the jobs, is there a variable or command we can test that will tell us
if the printer is free of jobs?

There might be a php function that will do this which is why I will
mirror this message in a php group, but in the mean time I would like
to know if there was a UNIX specific solution to this problem.

Best regards,

Chris Bennett, NapaNet

Rich Teer

2005-09-21, 8:49 pm

On Wed, 21 Sep 2005 cbennett@napanet.net wrote:

> The original script sent one huge print job to our printing server,
> which worked fine since we weren't printing duplex. We'd like to now
> split the jobs up and send them individually, which we easily achieved
> using a while loop to send each job.
>
> The problem is that since the printer is in duplex mode now, if you
> have two jobs which are 1 sheet each they will print them each on one
> side of the paper. Obviously not a good thing for two seperate bills.


Indeed! I'd create two printer queues: one for duplex printing, and
the other for single sided. Send your print jobs to the single-sided
queue and you should be OK.

--
Rich Teer, SCNA, SCSA, OpenSolaris CAB member

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com