How to read the lp job title from a Perl backend script?
I'm using the instructions from here to set up a TEXT-to-file printer.
I'm using CUPS. How do I get the job title parameter from the lp command, so I can incorporate it in the output file? Thanks! |
Quote:
Hope you read the comments as the article itself is the HARD way as the title says. -- Tony Lawrence http://aplawrence.com |
Thanks Tony, I did check the comments - the perl script seems to work nicely though.
We need a way to put the job title in the output file - is there a way to do it with the parallel port trick? |
Quote:
Examples of backend scripts are all over the web - google "cups backend". Sys V scripts: http://aplawrence.com/Unixart/cups_sysv_interface.html |
Thanks, I tried that, but I can't get it to write anything.
Here's my script: Code:
#!/bin/bash |
Quote:
|
Yes, I am. My lp command looks like
Code:
lp -d TEXT -t CUPSD /etc/cups/cupsd.conf Now, I set up my printer to send the output to /dev/null, because the interface should handle sending the data to the file, right? Or do I need to do something different? Here is my printer definition: Code:
<Printer TEXT> |
Quote:
|
What do I need to have in the interface to pass the title? Where do I define my output title?
I originally had set up a text printer to print to a file, in this case /usr/archives/txtrpts/report.prn But we discovered that when multiple users tried to print to the same file, their lpr processes would hang. So I'm trying to write something that won't hang because multiple users are trying to write to the same file simultaneously. I might just go back to the Perl server listening on a socket, at least I could get that to produce some output... Thanks for your help. |
Quote:
There were other pointers in the comments that might help. Sure was a lot easier with Sys V interface scripts.. |
Hey Tony, thanks for your help. I ended up modifying a pdf backend script to print to a text file, and it works.
|
All times are GMT -5. The time now is 01:22 PM. |