[cups.general] New to CUPS implemntation

alet at librelogiciel.com alet at librelogiciel.com
Thu Jul 24 23:14:17 PDT 2008


On Thu, Jul 24, 2008 at 10:32:37PM -0700, beckham wrote:
> Thanks for the reply.
> 
> To give u more insight of my problem. I will rephrase my problem.
> 
> We are going to create a web application. And the web application will be hosted on a weblogic server. My clients will be accessing my applicationj through internet. They have printers in their facilities or offices. They are planning to make the prinetrs available in internet by making the ip address of the printer a staic one and they will give us the static ip address to us.So When they say print in one of the page,i should find the printer which is there in their office and print the job to the printer automatically without user of seeing any printer dialog box and selecting the printer. The job of printing should take place as a back end process. I hope i gave more in depth of my problem.
> 
> Few replies for ur questions .
> 
> 1) As i cant show the printer dialog box , i cant use windows.print().
> 2) Moreover the persons who are accessing my application through internet gives me a predefined static ip address of the printer so they expects to get the data to be printed from the server directly to the printer at their site without they manually selecting the printer.
> 3) And we have one more requirement of scheduling printing jobs . Eg : On 23rd of every month the jobs to be send to the printers.
> 
> 
> These are my exact requirements

I'd say Tea4CUPS available from http://www.pykota.com is the way to
go.

You'll simply create a unique print queue (for example) to which all
your clients will print. This will be the only public print queue,
and it will be postscript preferably (to allow post-processing of the
jobs if all remote printers differ in supported page description 
languages)

This print queue will have only 'tea4cups://' as its DeviceURI.

Then you'll create one print queue for each remote printer, named
as you want. None of these print queues will be public. They will only
be accessible from localhost on your own CUPS server.

In tea4cups.conf you'll create one (or more) hook which will
extract the local print queue (but remote printer)'s name
based on the printing client's IP address or hostname, or any other
print job metadata, made available to your hook by Tea4CUPS through 
the use of environment variables (for example $TEACLIENTHOST). 
You could use a simple text file, like :

--- CUT ---
# Client IP           Local print queue => to remote printer or queue
192.168.45.123        HPMyClient1
....
--- CUT ---

or a database, or whatever, it's your choice.

Then when one of your clients prints to the unique print queue they
can see, Tea4CUPS will be launched, and Tea4CUPS will launch your hook
automatically after having retrieved the client's IP address or
hostname and other parameters from the print job. In your hook (which
is for example a shell script), once you've correctly detected the
name of the local print queue which points to the remote printer,
simply call :

  #! /bin/sh
  ...
  ... Extract TheCorrectQueueName
  ...
  # Requeue the job to the correct print queue
  /usr/bin/lp -U $TEAUSERNAME \
              -d $TheCorrectQueueName \
              -n $TEACOPIES \
              -t $TEAJOBTITLE \
              -o $TEAOPTIONS \
              $TEADATAFILE

This is untested so it probably needs some tweaking to make it work,
but I'm confident you can make it work in no time.

As for the scheduling of print jobs what you want is not very clear,
but you can always either save the $TEADATAFILE file for later use in
the same hook, or add another hook.

I mostly won't available beginning tomorrow until around August 15th,
but you can ask for help on the dedicated mailing list available from
http://lists.pykota.com/mailman/listinfo/tea4cups 


If you don't want to use Tea4CUPS for some reason, you could easily write
your own backend wrapper, but in the end it would probably do the same, so
why waste your time ?

hth

Jerome Alet





More information about the cups mailing list