Google Answers Logo
View Question
 
Q: Capturing LPR TCP/IP Print Jobs and storing them as .ps or .pdf files ( No Answer,   1 Comment )
Question  
Subject: Capturing LPR TCP/IP Print Jobs and storing them as .ps or .pdf files
Category: Computers > Operating Systems
Asked by: unlink-ga
List Price: $50.00
Posted: 22 Feb 2006 17:28 PST
Expires: 24 Mar 2006 17:28 PST
Question ID: 448594
The OS is SCO Unix, about 10 years old. It is running a proprietary
application that prints a nightly report and once printed it can never
be printed again.
For obvious reasons I have a need to capture a print job each night
(about 40-60 pages) and in addition of it printing to paper each night
I would like it to print to .ps or .pdf file that I can then ftp to
another machine as a backup. Too many times the printer has failed and
we have lost our reports.
The app uses the lpr printer deamon to print to a jet direct using tcp/ip.

I would like the end result to be:
Job is backed up to /var/bak/reportYYYYMMDD.ps
Job is then printed to printer.

Request for Question Clarification by sublime1-ga on 22 Feb 2006 18:06 PST
unlink...

I'm not a Unix user, but see if this helps:
http://csgroup.lbl.gov/unix/software/modules/tex/dvips.html

sublime1-ga

Request for Question Clarification by maniac-ga on 22 Feb 2006 20:10 PST
Hello Unlink,

A few ideas come to mind based on what you described, but a little
more information is needed to produce a proper answer. Could you
explain:

[1] The command line used to invoke lpr.  Is it something like:
  1a. lpr (lpr options) (temp file) 
  1b. (output generated) | lpr (lpr options)
or something else?
Based on that clarification, it should be feasible to produce a shell
script to replace the "lpr" used by the application and capture the
output prior to sending to the printer.

[2] Can you modify the file /etc/printcap and change the application
(or the environment variable) to change the printer destination?
If yes, it should be possible to add an (or change the) output filter
used by lpd to capture the output / send to the printer.

[3] What type of printer / output format are you using?
If the printer is using is PCL, and you really want Postscript (or
pdf) files, it would be necessary to convert the output format.

Thanks.
  --Maniac

Clarification of Question by unlink-ga on 23 Feb 2006 17:36 PST
I should have done a little more research before posting my first question.
I originally assumed it was using postscript, but now I see that it is in fact PCL.
[1]
The application calls lp about a dozen times: (not lpr like I thought) 
lp -onb -ofp18 -olpi8 -otl80 /usr/path/file1
...about a dozen more of these with a different path/file.

[2]
I could not find a /etc/printcap that I am used to finding on other
Unix, but it is configured through the Open Server GUI as an HPLaser
Network Printer. Not sure how SCO handles these.
Printer name is 'laser' and set as the default printer

[3]
Filter: /usr/spool/lp/model/HPLaserJet  (PCL)

I am ok with it storing raw pcl data in files.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Capturing LPR TCP/IP Print Jobs and storing them as .ps or .pdf files
From: chasenet-ga on 29 Apr 2006 16:53 PDT
 
Eeesh, that all seems rather complicated...

I would have used a packet sniffer which turns on at a certain time of
the day to capture packets based on a few filters.
If your looking for packet sniffers which can do that, there are 101
out there and all of them will offer enough filtering to do what you
need.   More over, there all free!! (for the most part)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy