Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!decwrl!adobe!greid From: greid@adobe.com (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: PS libraries Message-ID: <809@adobe.UUCP> Date: 3 May 89 01:34:33 GMT References: <2994@daisy.UUCP> <775@adobe.UUCP> <8751@polya.Stanford.EDU> <783@adobe.UUCP> <98@snll-arpagw.UUCP> <109@snll-arpagw.UUCP> Sender: news@adobe.COM Reply-To: greid@adobe.COM (Glenn Reid) Organization: Adobe Systems Incorporated, Mountain View Lines: 64 In article <109@snll-arpagw.UUCP> paolucci@snll-arpagw.UUCP (Sam Paolucci) writes: >I had only a three line script that accomplished the same thing. But it >doesn't solve the problem since a user can redirect stdout to a file, and >the if he uses the above routine to print it out, he than has not 1, but >2 ^D's, one in the file, and one appended when he prints it out. You missed the most important part of his message. The script/program to add a control-D is easy. The important part is OMITTING IT when you are writing to a file and you know you are writing to a file, and INCLUDING IT when you are writing to a device like a tty: >->Problem solved. Now you just have to teach your applications that emit >->PS to append a ^D if stdout is a device. On MS-LOSS it looks something >->like this: >-> >-> if (isatty(stdout)) >-> putc(4, stdout); > >The right answer is to have a print spooler. This would solve all the >problems. But until that happens, I think it is proper to generate the >PostScript files with a ^D at the end on machines that have a DEDICATED >(non shared) PostScript printer. The right solution is to do something different when you write to a local file. In fact, lots of things should probably be different, not just the ^D at the end. You should include the prologue, not just the document part (if you have downloaded the prologue separately into the VM of the printer on a "DEDICATED" printer). You should TAKE OUT any device-specific code that selects, say, a paper size, and put in COMMENTS instead that will teach a spooler somewhere else how to print the file correctly on a different printer. When you write a PostScript language program to a file, there are only three likely uses of it, in my opinion: 1. The user wants to drag the file to another system for printing, or mail it to his friend, or otherwise export the file. 2. The user wants to paste it into another application as an illustration (EPS file). 3. The user is a hacker and wants to hack and look at PS. In cases 1 and 2 above, you don't want ^D in the file. And if all you want to do is to print it on your dedicated printer, a three-line script will do it. Or you can COPY PSEOF.TXT yourself, since you typically have 30 seconds before you timeout. Sigh. I wish this weren't such a problem. IBM has recently come out with a PostScript interpreter for their 370 mainframe machine which can drive almost all of their printers. The single biggest red flag item on their list was that PC software puts ^D into print files, and they would generate an ERROR on the 370 machine. This is not a local problem, and it is false to assume that PostScript files are going to stay on the user's system, because people take them EVERYWHERE, and the people who get it right will have a lot more customers who are happy. Glenn Reid Adobe Systems