Path: utzoo!mnetor!uunet!husc6!endor!olson From: olson@endor.harvard.edu (Eric K. Olson) Newsgroups: comp.sys.mac.programmer Subject: Re: Sending PostScript through the printer driver Message-ID: <4275@husc6.harvard.edu> Date: 24 Mar 88 19:19:00 GMT References: <1344@ut-emx.UUCP> Sender: news@husc6.harvard.edu Reply-To: olson@endor.UUCP (Eric K. Olson) Organization: Lexington Software Design, Lexington, MA Lines: 55 In a recent article Rick Watson writes: >The following code fragment for sending a PostScript job to a laser printer >works under LaserWriter v3.2, but not 5.0. Can anyone tell me why not? >If no, does anyone have a code fragment that uses the pict comment >method of sending PostScript? What follows is code to send PS to the LaserWriter via the PicComment that turns DrawString() into a PS "Quote" function. I tried to use the PicComment "PS Quote" (Comment # 192) but couldn't get that to work (probably trouble turning the string into a Handle). Note that this code assumes that you are already in a Printing recording GrafPort and you've done everything you'ld do to print QuickDraw stuff. It send the PS in a STR# resource to the Laserwriter. printps() { PicComment(190,0,NIL); /* PS Begin */ PicComment(194,0,NIL); /* DrawString() == Postscript Text */ poststrings(256); PicComment(191,0,NIL); /* PS End */ } poststrings(id) short id; { short x; Handle pstext; short numstrs; unsigned char * where; pstext=GetResource('STR#',id); /* Header strings */ HLock(pstext); numstrs=*(short *)*pstext; where=(unsigned char *)*pstext; where+=2; for (x=0;x