Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing to a script

Status
Not open for further replies.

packback

Technical User
Aug 10, 2001
7
US
I want to be able to setup a printer that will pass data to a script that I wrote instead of a file. I need to do some processing of the data before I send it to a printer. I can print to a file, but I need to print to a script. I need it to be a lot like a filter that formats the text for a label printer. Is there anyway to do this?
Thanks
 
I ran into the same problem when I tried to make a work around for printing to a metacode Zerox printer. I was never able to make it work even when using pass through printing. And even when I captured the print job coming out of the port it was useless because of the PCL wrapped around it to control the printer. Hope you have better luck but like I said I never found a way to do this correctly.

Tcorum
 
You might try creating a print que under "OTHER" and use your script as the backend program. then send it to your printer. Learn something everyday or you wasted a day of your life.
 
I found a way around it, but I don't know how much I like it yet. I setup a printer (generic ascii) to print to a file. The file it prints to is a named pipe (FIFO) file. I then use a shell script with a while loop to cat this file to my script. The cat command sits on that file until something is written to it. It is working good right now, but only time will tell.
 
Try this:
[tt]
vi /etc/qconfig

preproc:
device = preprocdev
discipline = fcfs

preprocdev:
backend = /path/to/your/script
[/tt]

Print to your "queue" with
[tt]
qprt -P preproc /file/to/process
[/tt]
I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top