Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!ames!ncar!boulder!kevinj From: kevinj@boulder.Colorado.EDU (Kevin M. Jackson) Newsgroups: comp.windows.x Subject: Re: x bitmap to postscript Message-ID: <9940@boulder.Colorado.EDU> Date: 8 Jul 89 06:51:26 GMT References: <25539@shemp.CS.UCLA.EDU> Sender: news@boulder.Colorado.EDU Reply-To: kevinj@boulder.Colorado.EDU (Kevin M. Jackson) Organization: University of Colorado, Boulder Lines: 45 In article <25539@shemp.CS.UCLA.EDU> kwan@cs.ucla.edu (Edmund Kwan) writes: > > Is there a way to print bitmaps (X11 format) on an apple laser >printer? Thanks. This should do the trick. It was given to me by a friend I work with. I give no guarantees as to it's useability ;-) --------------------------- cut here ---------------------------------------- #!/bin/csh # # Xitops - Convert X icon to postscript printable file # # 4 Apr 1989 Hibachi # if ($#argv != 2) then echo 'usage: xitops source dest' exit endif set src=$argv[1] set dst=$argv[2] set width=`fgrep width $src | awk '{print $3}'` set height=`fgrep height $src | awk '{print $3}'` echo "doing $src --> $dst dims $width x $height" @ bytwid = $width / 8 echo '%\!' > $dst echo "/picstr $bytwid string def" >> $dst echo '72 dup translate' >> $dst echo '3 72 mul dup scale' >> $dst echo "$width $height 1" >> $dst echo "[$width 0 0 -$height 0 $height]" >> $dst echo '{currentfile picstr readhexstring pop}' >> $dst echo 'image' >> $dst tail +4 $src | tr -d ' ,;}' | sed 's/0x\(.\)\(.\)\(.\)\(.\)/\4\3\2\1/g' | tr '0123456789abcdefABCDEF' '084c2a6e195d3b7f5d3b7f' >> $dst echo 'showpage' >> $dst echo 'yo, done...'