Hello, I'd like to get started with PostScript. I'm completely new to it and would be very grateful to you for any hints. And my first question is (please don't ridicule me): how do I make a PostScript file? I mean, a plain text file with PostScript code, produced by hand. I read some chapters of a few tutorials and learned basics of the language's syntax, but didn't find anything on how to run it. First, do I have to make .ps the file's extension? Second, do I need (or when do I need) the %! command at the beginning of the file? And finally, what to do to make the computer execute the program?

> First, do I have to make .ps the file's extension?
Does your OS associate .ps files with a suitable "viewer" that would allow you to see your work drawn (much like a .jpg file would be rendered in an image viewer). It's not strictly necessary to have a .ps extension.

> Second, do I need (or when do I need) the %! command at the beginning of the file?
Always - otherwise it isn't a postscript file.

> And finally, what to do to make the computer execute the program?
IIRC, your average PDF file viewer will read postscript files as well.
Or you can just send it to your postscript compatible printer (though that might be a lot of paper for testing ;) )

Thanks!
I downloaded GhostScript and GSview. I will have to learn how to use them because now, it seems black magic to me. I know GhostScript is an interpreter and when I type commands, it executes them at once (I know this type of programming from Octave and Matlab). But I don't know how to load scripts to it, I don't know if I can make executable files. I have read somewhere that there is no compiler for PostScript, so how can one make an application with it? Is it impossible?

I don't know how to make Ghostscript (I use gswin32c - the cmd version, not gswin32) display the stack's content except by typing an incorrect command. And, what's most idiotic of me I have no idea how to exit GS without exiting cmd.

Thank you in advance for answering any of these questions or providing me with any useful links.

PS: As for the %! comment, I read somewhere that it is not in PostScript's specification. That's where my question came from.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.