Page Too Big

The other day I was able to look at an IBM OS/2 pre-release CD-ROM from early 1992. The CD-ROM appears to have been produced by IBM UK under the DAP (Developer Assistance Program) umbrella.

The CD-ROM contains about 250 MB of data and would have been the perfect medium for distributing the OS/2 pre-releases. The alternatives were either a huge pile of floppies or many days of downloading over a 9,600 bps modem (and filling up one or two typical hard disks in the process).

On the CD-ROM there’s not just the base OS but also a matching pre-release of LAN Server, Extended Services, Toolkit, and C Set/2 compiler. In addition, there’s all product documentation in electronic format—an alternative to many pounds of manuals.

I should add that IBM did ship these pre-releases on floppies, as seen e.g. here. But the full set would have been about 70 floppies, with no documentation. A single CD-ROM would have been vastly cheaper to produce and mail. As for printed documentation, I’m not sure if IBM even provided any; printing reams of manuals that were going to be obsolete in a month or two probably made little sense.

Obviously IBM didn’t ship the documentation as PDFs, because PDF wasn’t available until 1993. IBM also didn’t ship the documentation in PostScript format (Microsoft used that for NT pre-releases), perhaps because not everyone had a PostScript capable printer, but also because IBM already had a format which solved much the same problems as PDF, and it was called AFP.

The documentation was shipped as ZIP archives containing compressed .LIS files. The .LIS files were in LIST3820 format, a form of AFP. Also included on the CD was an IBM “internal use only” program called LP3820 by Ken Borgendale. The LP3820 utility ran under DOS or OS/2, took the AFP .LIS files as input, and printed them on HP LaserJet or PostScript printers, but could also produce plain ASCII files.


Obviously it would be desirable to convert the .LIS files to PDF. While AFP viewers exist, they are nowhere near as ubiquitous as PDF viewers. Running the .LIS files through LP3820 and then converting them PDF is easy. Most of the time.

Attempting to convert a random white paper (WP2OS2.LIS) presented an interesting challenge. On page 6 of the document, there is a large table. For reasons that I do not understand, the table is formatted such that it’s significantly wider than standard page size. It ends up getting cut off in the PDF, whether using GhostScript or Distiller to do the conversion.

Playing with the PCL output of LP3820 and the PCL viewer from the GhostScript suite I was able to confirm that the table is not cut off in the original. But getting all of it in a PDF wasn’t easy.

At first I tried using a pdfmark CropBox. But that did nothing, because the CropBox can only reduce the size of a page, not enlarge it. After a while I came to the conclusion that PDF conversion can’t really do much, the problem is lower down on the PostScript level.

So I dug up the PostScript Level 2 reference manual. A quick search for ‘page size’ homed in on the setpagedevice operator, with a promising looking PageSize option.

The PostScript files produced by LP3820 do not emit any page size information and 8.5 × 11 inch (Letter) paper size is assumed. The table needed significantly wider paper, at least 10 inches.

Using setpagedevice turned out to be the right solution. At the beginning of the document, I added

<< /PageSize [612 792] >> setpagedevice

although that was really redundant (explicitly setting 8.5 × 11 inch page size). On the problematic page, I added

<< /PageSize [756 792] >> setpagedevice

to set 10.5 × 11 inches page size (the units used are 1/72 in, so 720 corresponds to 10 inches). On the following page, I reset the page size back to 8.5 × 11.

This produced exactly the desired result: The document uses the standard page page size, only the one problematic page is wider. This kind of page size control works in both GhostScript and Distiller.

Another Nit

Before I even got that far, I had a different problem with the PostScript files produced by the old version of LP3820. I was able to convert the files to PDF with GhostScript, but not with Distiller. My best guess was that Distiller was complaining about a missing FontBBox.

LP3820 supplies two small specialty PostScript fonts. And sure enough, they define a FontBox but not FontBBox. The PostScript reference manuals claim that FontBBox is required for fonts.

So there’s an interesting discrepancy. I assume that back in 1991-1992, LP3820 produced output which must have worked on at least some PostScript printers. GhostScript is more forgiving, Distiller is more “by the book”.

In the end, it was not hard to edit two files LPLOGO.PSH and LPXTYP.PSH, and duplicate the FontBox line to get something like this:

/FontBox [0 -25 62 95] def
/FontBBox [0 -25 62 95] def

That made Distiller happy and allowed me to convert the files. I am fairly certain that newer versions of LP3820 do not have this problem.

Final Result

The resulting collection of OS/2 2.0 white papers from January 1992 may be viewed here. These were published under the IBM Personal Systems Software heading and cover OS/2 2.0 as well as OS/2-based products.

Note that page 15 in the PDF is the extra-wide one which needed special handling. I’m still not sure why that one table got out of control…

Update (Apr 26, 2022)

Comments pointing out that perhaps the oversized table was meant to be printed in landscape mode turned out to be absolutely correct. Running a newer version of LP3820 (version 2.7) produced a table in landscape mode, with no oversized page problem.

The updated PDF is here.

There is one other interesting difference between the old LP3820 version (1.3i) delivered on the DAP CD and the newer one. The old LP3820 positions each character individually, presumably using font metrics for AFP fonts. The new LP3820 positions words, not characters. As a result, character spacing within words is slightly different, because PostScript rules are used, rather than AFP. The new approach in my opinion produces better looking results.

This entry was posted in Documentation, IBM, OS/2, PC history. Bookmark the permalink.

4 Responses to Page Too Big

  1. Stiletto says:

    Great job!

  2. Chris M. says:

    Not putting PageSize at the beginning of each page was poor form on the developer’s part. Assuming everyone has US Letter sized paper is another one! Hopefully that document has sufficient margins for A4 paper users. Most printers likely don’t care because they know what size paper they have loaded in the tray and just cut off whatever doesn’t fit the page margins.

    Looking at the layout of page 15, it looks like it was intended for a landscape letter sized page. Setting PageSize to [792 612] likely works assuming the page footer is relatively aligned to the bottom right corner of the page, but I’d have to see the raw PostScript for that.

    As for the fonts, it looks like more sloppy coding. The “reference” printer of the time period was an Apple LaserWriter II, or an HP LaserJet with a PostScript cartridge. Both had genuine Adobe Level 1 or Level 2 interpreters. Adobe likely tightened up conformance with PostScript 3 interpreters like whats in Distiller.

  3. André says:

    I notice the table does not reach the bottom. May it be intended to go in landscape mode instead?

  4. Michal Necasek says:

    Yeah, the page sizes are a common problem. Not assuming Letter by default would probably break quite a bit.

    And… you’re totally right about the landscape thing. Turns out it’s a bug in the old version of LP3820 included on the CD. The table should be landscape, somehow LP3820 didn’t do it right. Newer LP3820 versions handle it correctly. Mystery solved!

    I’m really curious if a LaserWriter or a LaserJet with PS support would have accepted the fonts without FontBBox. But have no way to test that.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.