PostScript

Discuss Programming

PostScript

Postby worker201 » Sun Aug 29, 2004 1:40 am

I am trying my damnedest to learn PostScript, and I think I have some of the basic graphic operators nailed down. I'm starting to get a pretty good understanding of the stack, too. The red, blue, green, and ?grey? (Adobe type library) books have been excellent for this.

Unfortunately, I cannot figure out how to test my skills. I popped open a text editor, and wrote my code, now I need to display it. I have ghostscript and gview installed on my Mac, and they work, but they will not open my programs. None of the above 4 "rainbow" books mentions any sort of headers that a PostScript program needs to have (like the #!bin/bash of a shell script). Illustrator CS wants to open them as text files, and gview claims it has opened them, but will not display them.

Any hints on this? Does ghostscript need to process the files before gview can display them? Is there any kind of method to validate my PostScript code? And is there some PostScript integrated development environment out there?

Thanks in advance
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Sun Aug 29, 2004 7:39 am

Many programs in *NIX determine what a file type is by "magic". You can use the "file" command to see what format your system thinks a file is. For instance:

Code: Select all
$ file aboutkde.ps
aboutkde.ps: PostScript document text conforming at level 2.0 - type EPS


The rules for determining this are in a "magic" file. Most commonly the file is called /etc/magic but on my system it's /usr/share/magic or /usr/share/file/magic (there are a few other files in there that are related, mime types etc). Anyway, you can look through that magic file and see what it looks for to see how it determines if it is a postscript file. For example, if you simply start your document out with "%!" it will show up as "PostScript document text" when running the file command against it.

$ man magic
$ man file
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron