for adding meta-information
to PostScript document
s. PostScript itself is a programming language
: it is not in general
possible to discover what a PostScript file
does, short of run
ning it. For instance, determining the number of page
s in a file (or which version of PostScript the file requires in order to run) is impossible in a simple way; however, this could be useful information for a print spooler
, which certainly doesn't want to start trying to render
documents just to display how many pages they are.
On the other hand, almost all PostScript is automatically generated by programs, which usually have this meta-information. So it can be attached to the file, using the document structuring convention.
DSC is added inside specially-formatted comments which begin with "%%". Such comments announce information like the number of pages in a file, the start of a new page (and its page number in the document! Think of books with pages marked i, ii, iii, iv, 1, 2, ...!), what fonts it intends to use. One special set of comments announces that the file is intended to be encapsulated in a larger PostScript file; this creates an EPS file.
DSC is easily parsable; however, if one program creates misleading meta-information, confusion will ensue when other programs use this meta-information to massage the file. A particularly common instance is EPS files which aren't really, usually due to the appearance of a showpage command in them.