Dale Nurden's Home Page

How to Create a PDF File

Adobe's Portable Document Format (PDF) is a convenient way to distribute files that can be viewed and printed on Windows, Mac, Linux and other computers. Adobe produces a free program, Acrobat Reader for Windows, to view PDF files; similar programs exist for other operating systems. To create a PDF file you could buy Adobe's full Acrobat creation suite, which is quite costly. Or you could do it free using freely available software.

Contents

  1. What you need
  2. Installation
  3. How to create a PDF file
  4. Hints & Tips


What you need

Ghostscript is a command line postscript document manipulator. GSView is a graphical interface for Ghostscript that enables viewing, printing and, more importantly for us, conversion to other formats such as PDF.

Ghostscript and GSView are distributed under the Aladdin Free Public Licence, copies of which are included in each of the distributions. In essence the AFPL allows these programs to be distributed and used by anyone, free of charge subject to certain limitations. The licence does not affect the PDF files we create, and allows for personal and commercial use.


Installation

Postscript printer driver

  1. Open the Printers folder from the Start menu and double-click Add Printer.
  2. Choose Local printer and then choose a printer driver from the list of manufacturers and drivers. Any postscript printer will do. They can be identified by "PS" or "PostScript" in the name. A good choice is HP DeskJet 1200C/PS because it will enable you to produce colour PDF files.
  3. Connect the printer driver to the FILE: port.

Ghostscript and GSView

  1. Start gs703w32.exe to install Ghostscript. It is self-installing and you generally don't need to do anything special to install it.
  2. Start gsv40w32.exe to install GSView. It is also self-installing, but at the point where it asks about file associations, it is better not to associate GSView with .pdf files, otherwise it interfere with Acrobat Reader. Leave the association with postscript (.ps and .eps) files enabled.
  3. When running GSView for the first time, click Options, Easy Configure, choose the 7.03 version of Ghostscript and click OK.

Now you're all set to create PDF files.


How to create a PDF file

  1. PDF files can be created from any document that is capable of printing on the postscript printer driver you installed. That includes just about every program with a Print option, and even some old DOS programs that support postscript printers through their own drivers.
  2. Print the document after selecting the postscript printer. You might need to use a "Print Setup" or "Choose Printer" menu option to select the correct printer. You can also set printer options such as colour options and multiple pages per page if necessary. Check the "print to file" option (not necessary if the postscript printer is already connected to the FILE: port).
  3. When prompted for an output file name, type a name which ends with ".ps" and put it in a convenient folder. I just type "c:\a.ps" because it is quick to type without having to click through different folders. Depending on the application doing the printing it might be necessary to include the quotes, otherwise it might add ".prn" on the end of the file name.
  4. Open the .ps file you've just created. In the above example it is a file named "a.ps" located in the root of the C: drive, under "My Computer". It will open in GSView, which will is able to view and print the document, although that is not our intention right now.
  5. In GSView, click File, Convert.
  6. Under Device, choose pdfwrite. Under Resolution choose 300. Click OK.
  7. When prompted for an output file name, type a name which ends with ".pdf" and put it in a convenient folder such as "My Documents". You must include ".pdf" in the file name, because GSView won't put it in for you.
  8. You can usually ignore any warnings that might come out during the conversion process.


Hints & Tips

Creating a single PDF file from multiple sources

Sometimes you might have two or more separate documents that cannot easily be merged and printed to a single .ps file, for example a title page created in Publisher and the remaining content authored in Word. You can print each document to a separate .ps file, join all the files together and then convert the joined file to a single PDF file.

  1. Print each document to a separate .ps file using the above procedure, calling the first "c:\1.ps", the second "c:\2.ps" and so on.
  2. Open an MS-DOS Prompt or Command Prompt and change to the folder in which the .ps files were created by typing "cd\".
  3. Join all the .ps files by typing "copy /b 1.ps+2.ps a.ps", with all the individual .ps files separated with + symbols.
  4. Open the resulting file, named a.ps in this example, and continue with the procedure to convert it to PDF format.

How to reduce the size of the PDF file

PDF is a compressed format which includes compression of graphic elements. However you can help to reduce the size of the file by choosing a lower print resolution in the postscript printer driver when printing to the .ps file. It might also help to reduce the resolution in GSView when starting the conversion process.

If you use non-standard fonts in the original source, GSView might embed a copy of the font in the PDF file, increasing its size. Acrobat Reader allows to you see information about fonts in a PDF file you have already created by clicking File, Document Info, Fonts. Watch out for fonts that are not "Type 1". They may be embedded, and they tend to be slower to render too.

MS Word allows you to use a font named "Helvetica" even though it doesn't appear in the drop-down font list (just type the name in the font box and press Enter). This is a generic non-serif font which typically is rendered using a suitable substitution on the viewing computer. Use "Times" for a generic serif font.

Using .ps files as a print preview

Print Preview is a useful paper-saving feature in some programs that enables you to see what the printed output will look like before committing it to paper. Not all programs offer a Print Preview. For those that don't, select the postscript printer to first create a .ps file, which you can open and view in GSView. You don't even need to convert to PDF. When you're happy with the output, switch back to your regular printer to make the final print. Remember that printer settings are generally not retained when you change printers, so if you made any special settings on the postscript printer you will need to redo them after changing printers. Also bear in mind that because of font differences between printers, especially those that have built-in fonts, may mean that the printed output is not identical to the postscript preview.

Printing multiple pages on a single sheet

Some printer drivers offer the ability to print 2, 4, or more pages on a single sheet of paper by reducing the size of each page. If yours doesn't, you can achieve the same paper-saving result using the postscript printer driver in the above examples. Simply print your document out to a .ps file using the above procedures and with the "multiple pages per sheet" option enabled, open the resulting .ps file in GSView, then reprint the .ps file in GSView to your regular printer.


©2003 Dale Nurden
Duplication is permitted in full or part provided the author is acknowledged
http://www.nurden.za.net