Next 8.D: Cancelling Printing Up 8: Printing Files Prev 8.B: Text Documents Contents Contents

Basic

§ 8.C:  Printing PostScript Documents


PostScript files are text files containing programs written in the PostScript language. That language tells those printers able to understand it exactly how to draw a page with typesetting quality. PostScript files are often produced as output from programs such as xmgr, Netscape, Maple, and LaTex.

It is customary, and advised, to use the .ps extenders for PostScript files.

We will use the command mpage to generate a PostScript file. This command puts multiple pages of text OR PostScript format onto one page. (The enscript command discussed in the last section "only" put multiple text pages onto one physical page.) You can print 1, 2, 4, or 8 logical pages per physical page. The default is 4 logical pages in portrait mode.

You type mpage followed by the names of all the files you want printed, in this case the two files sample.doc and plotoutfile.ps. Just like with the enscript command, please have some compassion with the trees and redirect your output to another PostScript file. This way, you can inspect your output with ghostview to check whether it is what you want. Note that you will need an X window to run ghostview.

If you'd like to know what the actual PostScript looks like, you can enter

Notice that the file starts with the phrase %!PS-Adobe-2.0. This tells the printer this is a PostScript document. Notice too that the document is really long; the printer is being told how to draw and place every curve and every symbol in plotoutfile.ps.

As we mentioned earlier, you can print different numbers of physical pages onto a logical one. To do so, you put -1, -2, -4, or -8 after the mpage command but before the filenames. You might also have noticed that mpage puts every file's output on its own sheet of paper, even when there is room left for output from a second file. If you would like to change that behavior, include the -c option. This way, output from different files should be on different logical pages, but still on the same sheet. mpage has a rather nice man page, in which you can immerse yourself to discover the full power of this command.

Once you have a file that suits your taste, you print it just like any other (if you want, you can check the print queue first):


Next 8.D: Cancelling Printing Up 8: Printing Files Prev 8.B: Text Documents Contents Contents

Comments and questions to request@cs.fiu.edu.