🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #8266

PS libraries

#8266
From: Chung-Pang Lai
Date: Fri, 21 Apr 1989 07:51
52 lines
3204 bytes
In Glenn Reid's previous posting, he mentioned an idea of code factorization.
It is a very good idea especially for unix users.  Imagine something like:

	cat pie-chart.lib market-share.ps | lpr -Pps

A predefine set of functions (e.g. a pie chart drawing package) can be sold 
by PS software vendors and user of the package can write a simple few line 
program to pass data to the functions and outcome a nicely drawn EPSF ready 
for printing or import into other documents.

Just like a C program, we can use predefined functions by #include <stdio.h> 
and many many other packages.  C is a compiled language, the unresolved 
references to the external routines are handled by the linker.  In an
interpretive language like PS, the unresolved references can be handled
by a preprocessor and the functions' definition is downloaded to the printer
before the job is.  If the preprocessor is well written, it will include
only the function needed and hence reduce the download time to the printer.

Many users have struggled with Mac PS files on unix printer simply because
the laserprep is designed for apple printer and cannot be used on a unix 
printer.  If the prolog and the script of a PS program are stored separately, 
a PS file will only contain the script and a PRAGMA to indicate that it uses 
the laserprep library.  When the file is printed on a mac, the mac driver
prepend the mac version of the laserprep designed for the specific printer
before the job is send to the printer.  On a unix system, the preprocessor 
or the driver add the unix version of the laserprep to the job.  Firstly, 
all PS file will be shrunk to its minimal size and hence save a lot of disk 
space.  Secondly, all PS file can be more portable as long as everyone is 
using standard packages.

Imagine if you need to print 10 Adobe illustrator files, the Adobe prolog
is inside each file and hence is download to the printer 10 times.  However, 
if Adobe release an Illustrator library, and the Illustrator program only 
output the script portion, then the files are much much smaller and the 
printing is much faster because the prolog is down load only once.  
e.g. 	cat Illust.lib pic1.art ... pic10.art

Seem like this can be done without any modification to the language.  Perhaps
a %%include meta-comment can be added to the conforming PS standard.  It is
just a matter of changing the coding convention.

Why wasn't it done?  Did I miss something?

Please reply thru e-mail because by the time I get back from vacation, the
news article will expire.  e-mail to pyramid!daisy!cplai   Thanks.


-- 
.signature under construction ...
{pyramid, osu-cis, uunet, killer}!daisy!cplai    C.P. Lai
cplai%daisy.UUCP@uunet.UU.NET   cplai%daisy@killer.DALLAS.TX.USA
Daisy Systems Corp, 700B Middlefield Road, Mtn View CA 94039.  (415)960-6961
Technical Details
Message-ID: <2994@daisy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!atari!daisy!cplai

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!atari!daisy!cplai
From: cplai@daisy.UUCP (Chung-Pang Lai)
Newsgroups: comp.lang.postscript
Subject: PS libraries
Message-ID: <2994@daisy.UUCP>
Date: 21 Apr 89 07:51:41 GMT
Organization: Daisy Systems, Mt. View, CA
Lines: 52