OS/2 eZine

16 October 2000
Robert Basler is the president of Aurora Systems, Inc.

If you have a comment about the content of this article, please feel free to vent in the OS/2 eZine discussion forums.

Previous Article
Next Article

Creating Adobe Acrobat Documents in OS/2

Last month I showed you how to use Ghostscript to provide printer output for your LAN attached Macintosh computer. This month, I'll build on that base to show you how to create Adobe Acrobat PDF files using Ghostscript and GSview on OS/2. If you don't have Ghostscript installed and configured already, have a look at last month's article on how to do that.

If you don't already have GSview, you can get it from http://www.cs.wisc.edu/~ghost/gsview/index.html.

Installing GSview

Installation of GSview is pretty easy, after you have obtained gsv34os2.zip, place it in a temporary directory and unzip it. Then open the readme.htm file with your favourite web browser and follow the handy instructions there.

One tip I will give you is that after installation, the first time you run GSview, choose Options, Advanced Configure from the menus and check the Ghostscript Include Path very carefully. I got no end of font missing errors due to a typo in my font path.

Building your First PDF

Once you have installed GSview, building a PDF file is a five step process:

1 - Design your document in your favourite program.
2 - Print the document to an EPS file.
3 - Open the document in GSView
4 - Convert the file to a PDF using Ghostscript.
5 - Check the PDF.

I'll talk about each of those steps below.

Designing your Document

You can use any OS/2 or WinOS/2 program to design your PDF document. I was using Corel Draw in WinOS/2 for mine.

If you are using an OS/2 program, there is one small additional step. Open your printer object, open its properties dialog, and go to the Output Port tab. Check the "Output to File" checkbox to make OS/2 prompt you for a file name to write the output to, rather than sending it to the printer. You will need to change this checkbox back if you want to print from your Mac. Since I create PDF files so rarely, this is what I do. If you are going to be creating PDF files frequently, you probably want to create a second printer object just for writing PDF's.

If you are going to use a WinOS/2 program, you need to use Print Manager to install a postscript driver for WinOS/2. After much experimentation, the one I ended up choosing was the OceColor G5242 postscript printer. This was the only one that offered color and 11"x17" paper as options.

After you install the printer, you need to go into its options dialog. In Print Manager, click on the printer, then choose Options, Printer Setup. Click on the printer again, then click on the Setup button. Click on Options. Choose the Print To Encapsulated Postscript File and then enter a file name. This is the file that the printer driver will write to which can then be converted into a PDF. You'll also want to make sure "Send Header with each job" and "Color" are checked. Click on the Advanced button and make sure that "Conform to Adobe Document Structuring Convention" is checked. Ok out of all those dialogs.

Printing the Document to an EPS file

Once you have the appropriate printer objects created, you need to print your document to an EPS (Encapsulated Postscript) file. In OS/2 you will be prompted for the name of the EPS file, for WinOS/2 programs, they will always write to the file you specified in the printer driver.

Open the EPS Document in GSview

Once your EPS file is created, you want to run GSview and open it. You should see the first page of your document in the GSview window. If your document has multiple pages, you can use the + and - buttons to move from page to page. One limitation I found is that if you cannot print all the pages of your PDF document in one print job, there seems to be no way to combine more than one print job, say from different applications, into a single PDF. If you want to do this, you will need to try the Acrobat tools from Adobe which offer this ability.

If you find that the paper orientation is wrong, or the wrong size paper is selected so that part of your document is cut off at the edges, look at the Media menu and select the desired paper and orientation.

Convert the EPS file to a PDF

Converting the EPS file to a PDF is easy, choose File, then Convert from the GSview menu. Choose the pdfwrite Device, select the desired resolution, and the pages that you wish to convert. The higher resolution you select, the larger the PDF will be. Keep in mind that most displays are around 70dpi so if your PDF is going to be seen mostly on computer screens, you will want to pick a lower resolution. You may also wish to go into properties and select the CompatibilityLevel setting which can be 1.1, 1.2 and 1.3. These are the versions of the Adobe PDF specification GhostScript supports. Choose a lower version for widest compatibility and a higher version for better compression.

Once you click on Ok, GSview will start Ghostscript, and if all goes well, a window will appear showing you the progress of the conversion. If there is a problem with the document, error messages will appear in this window. If you get "font not found" errors, check carefully your Options settings for paths as I mentioned above.

Check the PDF File

Creating PDF's isn't an exact science, so I recommend carefully checking your PDF in a number of viewers. I found that some PDF's I created had mangled bitmaps when displayed in OS/2's Acrobat Reader, but they displayed perfectly in GSview and in the Windows versions of Acrobat Reader. Other users reported that the same PDF viewed fine on their OS/2 systems, so this may be related somehow to my system.

PDF's are a great business tool, saving trees and printing costs at the same time. Now they can be made quickly and easily in OS/2 without the need to run another OS and purchase Adobe's tools.

Previous Article
Next Article