If you get an error like this:
PostScript Conversion Error
The PostScript file could not be converted to a PDF file.
when trying to open a PostScript file (with .ps extension), you can use macps
to fix it.
This utility will transform old PostScript files that were prepared for certain Apple laser printers into standalone files that can be read by any PostScript interpreter; in particular Preview.app on modern Mac OS X.
The issue is that the files relied on certain definitions provided the printer's PostScript interpreter. If you have saved PostScript files like this, this utility fixes that by replacing the include statement with the correct version of actual definitions.
The original source files are copyright by the University of Calfornia.
The changes made here are trivial (just updates to make it work on a modern Mac) and are licensed under the MIT license (if anyone cares).
-- Mike Carlton (July 2019)
make
sudo make install
To display the original man page:
man /usr/local/man/man1/macps.1
To fix an unreadable PostScript file "foo.ps":
macps foo.ps > foo-new.ps
To fix an unreadable PostScript file and convert it to PDF (recommended), use the Mac's
included pstopdf
like so:
macps foo.ps | pstopdf -o foo.pdf
You can then open the file from the Finder or directly from the command line:
open foo.pdf
The original ReadMe
file is reproduced below (and is included in the repo)
COPYRIGHT NOTICE (SCCSid = "@(#)ReadMe 2.2 10/24/89")
Copyright (c) 1988, The Regents of the University of California. Edward Moy, Workstation Software Support Group, Workstation Support Serices, Information Systems and Technology.
Permission is granted to any individual or institution to use, copy, or redistribute this software so long as it is not sold for profit, provided that this notice and the original copyright notices are retained. The University of California makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
WHAT IS MACPS?
Macps is a Unix program that takes an uploaded PostScript file created on a Macintosh (by typing Command-F at the LaserWriter dialog box; see macps.1 for more details) and includes an appropriately modified LaserPrep file so that the result can be sent to a PostScript printer From Unix. The LaserPrep file contains macros used by the PostScript generator on the Macintosh.
WHY IS MACPS NEEDED?
This is how Mac printing works. When a Mac talks to a LaserWriter, it asks if the LaserWriter has had a LaserPrep file downloaded to it. A LaserWriter that is first powered up, has no such LaserPrep file, and so the Mac downloads it and makes the LaserPrep file resident in memory. Then the actual print file is sent to the LaserWriter. Subsequent print requests need not download the LaserPrep file, unless it is a different version.
Since a LaserWriter connected to a Unix system usually does things other than Mac printing, it is unwise to make LaserPrep files resident in memory so that other PostScript jobs have less memory to work with. What prepfix does is to modify a LaserPrep file so that, among other things, it does not make itself resident in memory. Thus, the LaserPrep file must be downloaded for each Mac print job. This is the function of macps, to automatically append the appropriate LaserPrep file.
WHICH VERSION OF THE LASERPREP WILL BE USED?
Macps interprets the %%IncludeProcSet directive found in the PostScript generated by LaserWriter driver 4.0 and greater. It takes the ProcSet id and looks it up in a file "macps.config", to get the pathname of the prep file, and thus macps can convert PostScript generated by different versions of the LaserWriter driver.
HOW ARE THE LASERPREP FILES GENERATED?
Since the Apple LaserPrep files are copyrighted, I've included a program, prepfix, that reads version 4.0 and up LaserPrep files, and edits them so that they are compatible with Unix, and are even electronically mailable (See prepfix.1 for more details).
WHERE IS THE MACPS.CONFIG FILE LOCATED?
Macps has some special code that is able to figure out from which directory it was called from. It will then look in a "lib" subdiretory for the macps.config file.
WHAT ABOUT BIT-SMOOTHING ON NON-LASERWRITER PRINTERS?
For PostScript printers using Motorola 680x0 processors and Adobe PostScript firmware other than LaserWriters, there is an option that will allow these printers to do bit-smoothing, just like LaserWriters.
CHANGES IN VERSION 2.2
Version 2.2 of prepfix now supports LaserPrep 6.0. The PostScript save/restore context is now a compile-time option, since it caused printing to fail on a NeXT printer (though it was harmless on most other printers). This save/restore is now more intelligent about clearing the stacks.
CHANGES IN VERSION 2.1
Version 2.1 of prepfix uses a safer method for turning on bit-smoothing for non-Apple printers. This should get around some of the problems people have been having with specialized macros in the LaserPreps that are Apple printer specific. The -l and -p options in version 1.1 have been replaced with the single -l option, and the limit on the number of printers you can specify has been removed.
Also, prepfix removes some other various macros that cause unpredictable problems, and a problem with Apple LaserWriter II/NTs (but not other Apple printers).
Version 2.1 macps has several new options. The -c option allow you to specify the number of copies to generate (overriding any multiple copy option that was specified on the Macintosh). The -d option allows an alternate directory to look for the macps.config file. Finally, the -r (raw) option suppresses the conversion of 8-bit binary into ASCII, and is useful for some graphics programs that manipulate gray-scale images, and produce 8-bit binary PostScript output.
Macps will even work with a NeXT laser printer, but (at least the 0.8 version of the operating system) will not do bit smoothing. Beware, though, that if you print Macintosh patterns at 400 dpi, they will look funny. `