News Shareware IServices Resellers Projects Partnerships
Generating and emailing PDF files using SCO Openserver 5 via the LP spooler using txt2pdf by
Gavin Jackson

SCO Openserver is a versatile commercial operating system, It has been the workhorse of many businesses for years now. The operating system supports both local and remote printer types (Along with HP network print servers). By default, the operating system has a version of sendmail installed to handle email from the server to other email destinations. Perl 5.005 is available from www.sco.com/skunkware as a "custom" installable package to enhance the operating system. By using the inbuilt features in the operating system and the readily available perl, we are able to create e-mailable reports from the system via the printer spooler in real time using the local printer command suite

This allows us to send and format reports via email to virtually any emailable destination.

The following informatiion outlines the methods and installation method of the tools. I trust you will find it as useful as we do.

How SCO printing works

SCO Openserver uses files located in the /usr/spool/lp/model directory as base templates for it's printers.
When a printer is created it takes a copy of the base script and copies it to the /usr/spool/lp/admins/lp/interfaces directory as the printer name that you specify.
For example, Creating a printer called "local" is achieved by the printer creation program copying the /usr/spool/lp/model/standard script to the /usr/spool/lp/admins/lp/interfaces/local file.
After the spooler has created the spooler queue, It is possible to use the lp command such as
lp -d local /etc/hosts
to print out the file using the print spooler as normal.

We use a modified version of the base "standard" script to create the the PDF email files.

Requirements

- SCO Openserver 5.0.4 or greater (5.0.5 and 5.0.6 have been successfully tested)

- Perl 5.004 or greater (available from www.sco.com/skunkware as a custom installable package)

- Sanface's Brilliant TXT2PDF script

- MPACK 1.5 (To encapsulate the PDF as an attachment)

- Your time and Skills

Installation

Copy the pdfmail script in this directory to the /usr/local/lp/model directory and set it's permissions to the same as the other printers in the directory.
Download the executable copy of mpack from ftp://ftp2.caldera.com/pub/skunkware/osr5/vols/mpack-1.5-VOLS.tar and install it into your /usr/bin directory of your server. Source txt2pdf and install it.
On my system, I use the /txt2pdf directory to locate the SANFACE software.
Using the standard scoadmin printer manager tool from the command line, Create a printer called pdfmail using the standard model of pdfmail as it's model type, Under device modify to /dev/null as the output source. (This is a standard SCO method of printer installation for a local printer)

Testing

At the command prompt, Type in
lp -d pdfmail -t <Your email address> /etc/hosts
and your SCO server should generate an email with your /etc/hosts file attached as a pdf file and email to your email address.
The advantage of using this method of printing is that you are using the local printer spooler to manage the pdf generation and this extra feature can be added to most existing legacy applications.
We use the -t option to pass the email address of the mail recipient to the spooler as a standard variable. Normally this option is used to add a title to the banner page which can be sent on a page preceding a normal printout, as this is rarely used, We use this option as the email recipient address.

Document Author

Gavin Jackson
Technical Manager
www.insurance.com.au
email: gavin@insurance.com.au

In Association with Amazon.com

SANFACE Software logo


txt2pdf is a trademark of SANFACE Software 2004.
Your technology glasses. We help you see your full potential.
mailto:sanface@sanface.com WAP http://www.sanface.com/wap/
http://www.sanface.com I-mode http://www.sanface.com/i/

News Shareware IServices Resellers Projects Partnerships