Subject: 1 General Questions Subject: 1.1 What is PostScript? PostScript is a page description programming language. It is perhaps the most versatile and loved language for printers, being used in printers world-wide. It is capable of drawing to computer screens and any kind of drawing device. PostScript is interpreted, stack based and has latent typing. It somewhat resembles the computer language FORTH. A number of programmers write PostScript programs directly for a variety of drawing applications. However, PostScript programs are usually documents meant to be printed that have been generated by a program written in some compiled language. Subject: 1.2 How can I tell how many pages my document will have? The easiest way to count pages is view your document on-line with a PostScript previewer. Some previewers like Ghostview and GSPreview count the pages for you. (See Section 12, ``PostScript Interpreters and Utilities''.) If your document is generated by a program compliant with the Document Structuring Conventions, you should be able to just count the number of ``%%Page:'' comments imbedded in the document. With UNIX you can type grep -c %%Page: document.ps to do this counting. (See Section 9, ``Encapsulated PostScript''.) The only completely reliable way to count pages is to ask the printer after the job is printed. PostScript printers maintain a page counter that can be queried before and and after the job is printed, and the page count is a simple subtraction. This tends to require rather sophisticated spooling systems and a communications channel that is bidirectional. However, some printers allow you to submit jobs on one port, and issue queries on another. Send this PostScript through a bidirectional I/O port and you'll get back the page count, nominally the total number of pages printed since manufacture: statusdict begin pagecount == end flush Experts using a level 2 printer can use the SerialOff.PS and SerialEHandlder.ps programs to communicate bidirectionally to the printer. Subject: 1.3 How can I print just one page or a few pages from a big document? How can I print pages in reverse order? Try using a host-specific program, like the UNIX command psrev, which is part of the TranScript suite of software from Adobe Systems. Or use the more general utilities Ghostview, psutils or psxlate. There is no guarantee that a given PostScript document can be split in such a manner. The reason is that some programs which generate PostScript code don't conform to the Adobe Document Structuring Conventions (DSC). (See Section 9, ``Encapsulated PostScript''.) A notable example of this is Microsoft Word. Subject: 1.4 How can I print more than one page per sheet of paper? Use psnup or pstext or enscript. These programs redefine the PostScript ``showpage'' command to do multiple PostScript pages per physical page. If one program doesn't work with a complex document, try out other ones. Some PostScript programs can't work with these programs because they break the EPS conventions (See Section 9, ``Encapsulated PostScript''.). The reason is that some Postscript operators (such as initgraphics, the list is in the Red book) change the printer state so "violently", that software trying to do things like n-up will get confused. Theoretically, an EPS shouldn't have any of these operators, but it may not really be an EPS, or there may be a weird interaction between TeX, the EPS and the inclusion mechanism that breaks psnup. Subject: 1.5 How can I edit a PostScript picture? If you know the PostScript programming language, just use any text editor to edit the code directly. If you want to do it visually, you can use Canvas on the Macintosh. Subject: 1.6 How can I print PostScript on a non-PostScript printer? You need a tool that converts to something that your printer knows how to print. Use Freedom of Press, GhostScript, pageview, TScript, or UltraScript PC. Or, use a printer cartridge if your printer manufacturer sells one. Subject: 1.7 What other graphics languages are there? HPGL is for pen plotters. PCL is for HP Laser printers (and compatibles). Both are by HP, and PCL5 is supposed to allow inclusion of HPGL commands, preceded by an appropriate escape code, however I have found this to give errors and abort even for simple HPGL code that plots fine on a plotter.