Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!execu!sequoia!rpp386!woody From: woody@rpp386.cactus.org (Woodrow Baker) Newsgroups: comp.lang.postscript Subject: Re: need *simple* way to print ascii files on laserwriter Summary: lets find one... Message-ID: <17862@rpp386.cactus.org> Date: 4 Feb 90 05:35:16 GMT References: <1990Feb2.220910.16236@umn-cs.cs.umn.edu> Organization: River Parishes Programming, Plano, TX Lines: 49 In article <1990Feb2.220910.16236@umn-cs.cs.umn.edu>, wytten@umn-cs.cs.umn.edu (Dale R. Wyttenbach) writes: > Suppose you want to print the file /etc/hosts on a laserwriter that > is hooked up to your unix box on /dev/ttyh1. >...with CR's > in the appropriate places, and tabs expanded to 8 spaces. I don't > care what you do with other unprintable ascii characters; maybe print > their octal representation. > This question is so common, that we need to find a simple shorty to send to people. I propose that we sort of run an informal contest here to see who can write the shortest file printer in PS. At the minimum, it should 1. understand cr/lf's 2. use courier as it's font 3. expand tabs to blanks. A routine from the Green book handles 1 and 2 nicely. I thing it was written by Glenn. I have entered it below, and cleaned up the bracketing so that it makes sense.... /buff 128 string def /emulate1 { { currentfile buff readstring exch show not {exit} if } loop showpage } bind def 72 750 moveto /Courier findfont 10 scalefont setfont emulate1 .. ....text follows...... Cheers Woody u > Please respond via email. > > Thanks > > dale > > > Dale Wyttenbach | ...rutgers!umn-cs!wytten > wytten@cs.umn.edu | wytten@umnacvx.bitnet > Computer Science Department Systems Staff--University of Minnesota, Minneapolis