- Convert each of your word-processor documents into a PostScript file.
- Make a “command file” containing all the commands and information needed by Ghostscript to combine and convert your multiple PostScript files into one .pdf file.
- Run Ghostscript, telling it to look in the “command file” for additional instructions.
Convert each of your word-processor documents into a PostScript file
Note that when you follow the steps outlined on the web-page above, you will end up with a bunch of files ending with the extension “.prn” (short for “printer”). These are PostScript files (meaning that they contain printer instructions written in the PostScript language). From here on out, they will be referred to as “.prn” files.
Install a PostScript printer driver
What you are doing here is installing the software that Windows uses to talk to a printer (that’s what a “printer driver” is.) Instead of sending the printer instructions (put a blob of black here, there, and there) to a physical printer attached to your machine, the instructions are saved to a file. So now you have a file that says “put a blob of black here…”. That file can be opened and read by lots of different programs which can convert printer instructions into “screen instructions” (“put a 10 pixels of black in the upper left corner…”).
Note: The details of installing a printer vary slightly from one version of Windows to another. The instructions below are general. For more detail, read the Windows help files, or the manual. (You do know where your manual is, right?)
- Click on the Start Button
- Go to “Settings”
- If “Printers” doesn’t appear in the Settings sub-menu, click on “Control Panel,” and “Printers” should appear within the Control Panel
- Look for the icon labelled “Add Printer”
- Double click on the “Add Printer” icon
- You will be asked several questions about the new printer you’re installing. We won’t try to answer them all here, but we’ll cover the important ones:
- This should be a “local”, not “network printer
- The printer we recommend choosing is the “Apple LaserWriter Pro 600.” Note:There are several other printer drivers that are worth experimenting with if your .ps/.prn files don’t look correct when you open them in GhostView: Adobe Generic PostScript Printer Driver for Windows, and for Mac. If you have color images, you may want to try the “Apple Color LW 12/660 PS” or some other PS printer driver with the word “color” in its name (e.g., some of the HP printers).
- When you are asked what port this printer will connect to, tell it to use “FILE” (i.e., it will print to a file rather than an actual printer).
- Do not set this as the default printer for your system…unless you really want to.
Convert your word processor file to PostScript format
- With your document open in your wordprocessor program, tell the program to print your file.
- When the program asks you which printer to use, select the “Apple LaserWriter Pro 600” which you installed earlier.
- If you didn’t specify that the printer should use the “FILE” port when you installed it, tell the wordprocessor that you want to print your document to a file (look for the “print to file” option).
- After you click on “OK”, you will be asked to name the file that will be generated by the printing process. Please follow the instructions below about putting numbers at the beginning of your file names. Please do not put any spaces in the filename. The file generated by this process will have the suffix “.prn” (printer). There is no need to remove or change this suffix. This file contains instructions for printers written in the PostScript language.
- Repeat the conversion process for all the files you have
Making a working directory
- Make a new directory where you will do all the following work
- Copy (DON’T MOVE) the .prn files to this new directory
Making a “command file”
The “command file” contains all the commands and information needed by Ghostscript to combine and convert your multiple .prn files into one .pdf file.
- In your new working directory, create a new text file. Call it anything you like; we recommend “gscommands.txt.” We will refer to this file as the “command file” from here on out.
- Open your new “command file,” and insert the following text (all one line):
-dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=<name of the final pdf file> -dBATCH <name of the first .prn file> <name of the next .prn file> … <name of the last .prn file>For example:
-dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=myThesis.pdf -dBATCH abstract.prn “title page.prn” approval.prn dedication.prn “table of contents.prn” “chapter 1.prn” “chapter 2.prn” conclusion.prn “references cited.prn”Note: If the name of a file has a space in it (e.g., “title page.prn”), you need to put quotation marks around it. If the filename doesn’t have a space in it, you don’t need quotation marks.All the information in the “command file” needs to go on one line. A lot of text editors/word processors/etc. will wrap the line around for you if you have “word wrap” turned on, so it will look like multiple lines. Turn off word wrap, or turn on “view hidden symbols” or “view codes” or whatever you have to do to make sure there are no returns/line-feeds/new-lines/new paragraphs anywhere in the text of the command line.Suggestion:
Make life easier on yourself. When you are converting your wordprocessor files into .prn files, don’t put any spaces in the names of the .prn files. Even better, name them as numbers. If you do this, you can change the text in the “command file” to:-dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=myThesis.pdf -dBATCH 1.prn 2.prn 3.prn 4.prn 5.prnWho knows, maybe this is more trouble than it’s worth. That’s up to you.
- Save your modified “command file.” You can close it or leave it open to edit it further if necessary. Remember to save it again if you make and subsequent changes.
Run Ghostscript, telling it to look in the “command file” for additional instructions
- Open a DOS command prompt
- Telling your computer where to find Ghostscript (i.e., put Ghostscript on your “path”)
- Find out where Ghostscript has been squirreled away on your system, and find its “program file directory” where the “bin” (binary) and “lib” (library) directories are stored.
In the above case the “program file directory” is “C:\gs\gs7.00”
- Finding out the name of the Ghostscript program file: Look in the the “bin” directory you found in the previous step. The program file is probably called something like: “gswin32.exe”. You’ll need to remember this for later. We’ll refer to it as the “Ghostscript command”.
- Tell DOS how to find these directories by typing the following command:SET PATH=%PATH%;<program file directory>\bin; <program file directory>\lib
replacing <program file directory> with the name of the “program file directory”, which you determined in the previous step. Note that you need to put quotations around a directory name if it has any spaces in it. For example: “C:\Program Files\gs\gs7.00\bin”.
SET PATH=%PATH%;”C:\Program Files\gs\gs7.00\bin”;”C:\Program Files\gs\gs7.00\lib”
SET PATH=%PATH%;C:\gs\gs7.00\bin;C:\gs\gs7.00\libNote: At this point, you can test to see if your modification of the “path” has worked. Type the following command:
and DOS should respond by showing you all the different directory names stored in the PATH variable. The ones you just added should appear at the end. If they don’t, try again. If they still don’t you should probably contact us for help.Different versions of DOS work slightly differently. Consult your DOS documentation for full (yeah, right) details, and contact us if you have any questions.
Navigating your already-open DOS command prompt to your working directory
Use the “cd” (change directory) command as follows:
cd <full path name of your new working directory>
For example: cd “c:\personal files\gradschool\dissertation\tempPDFoutput”
Execute the “Ghostscript command” and tell it to use your “command file” in the following way:
<Ghostscript command> @<name of your command file>
For example: gswin32.exe @gscommands.txt
Once you do this, a new window will open up. This is the ghostscript console. It will rapidly scroll through a bunch of messages as it processes your files. You don’t have to pay any attention to them or the window itself. The window will close of its own accord.
Check to see if everything worked correctly
- Click your “working directory” window
- Check if your pdf file was created
- Open it to see if it was created correctly