PostScript Utilities This document summarizes the PostScript utilities on the accompanying disk: PPEPSF which converts an AutoCAD PostScript plot file to an Encapsulated PostScript file. SLD2PS which converts an AutoCAD/AutoSketch slide file to a PostScript file. Optional encapsulation & color output flags are provided. ADI2PS which processes a Binary ADI plot file to produce a PostScript file. Line widths can be assigned to "logical" pen numbers. Optional encapsulation is also provided for. These utilities are primarily meant for use while interfacing desktop publishing packages to Autodesk products like AutoCAD Release 9 & 10 and AutoSketch 1.04 & 2.0 and AutoShade 1.1. These utilities are designed to work under MS-DOS. Consequently, the input files for these utilities should also be created by an Autodesk product running under MS-DOS. BACKGROUND PostScript is a page description language developed by Adobe Systems Inc. It serves as the basic page layout language of several laser printers and is a natural output medium for the desktop publishing packages seeking to merge text & graphics and to provide WYSIWYG output. AutoCAD, AutoShade & AutoSketch are graphic design tools. While each of these can provide generic PostScript output, certain extensions to this output can be made in order to enhance their usefulness as PostScript data. DEVELOPEMENT These utilities are not very ambitious in their scope. In all 3 cases, Encapsulated PostScript output is provided for. The major intent behind SLD2PS was to provide a "screen dump" capability while that behind ADI2PS was to provide for line-width assignment to logical PostScript pens. SLD2PS additionally provides for full 256 color output (commercial color PostScript printers have begun emerging in the hardcopy marketplace). PPEPSF is a pure PostScript --> Encapsulated PostScript output utility. The major reason for the development of these utilities was the fact that I heard about AutoCAD users asking for them. Please feel free to comment on these routines, suggest enhancements, reportproblems etc. For the more adventerous users, the full C source code is available should you desire to make any modifications or bug fixes. Splicing code from these utilities into commercial or shareware utilities is an absolute no-no in my mind, modifying them for personal use is perfectly ok. PPEPSF This utility takes a standard AutoCAD/AutoSketch/AutoShade PostScript file and post-processes it into a format accepted as Encapsulated PostScript. The calling syntax is : PPEPSF Example: PPEPSF mpart PPEPSF mpart mpart2 The file extensions .plt and .eps are automatically tagged on. The output file name is optional. If it is not provided, the input file name is assumed as the default. Both AutoCAD & AutoSketch plot files are output with .plt file extensions. This utility essentially constructs a header in the PostScript file that looks like: %!PS-Adobe-2.0 EPSF-1.2 %%Bounding Box: llx lly urx ury %%EndComments AutoCAD & AutoSketch files output Bounding Box information but this is done at the end of the file. AutoShade 1.0 files are similar in this respect but AutoShade 1.1 files are output in Encapsulated form. The algorithm used is simple: make two passes on the input file, finding and storing the Bounding Box string the first time. On the second pass, replace the Header with this new EPSF type header. No other changes are made. This utility was tested successfully with Xerox's Ventura Publisher and Aldus' PageMaker. SLD2PS This utility process an AutoCAD Slide file to produce a PostScript or Encapsulated PostScript file. It treats the PostScript device akin to a display device, supporting hardware fill. It also supports the full 256 color AutoCAD palette. Both the "old" and the new Release 9 style slide file formats are supported and SLD2PS automatically detects and adapts to each. An important point to note is that the resolution of the PostScript output is strongly affected by the resolution of the graphics area in which the slide was created. Thus, a slide file created on a 8514 display will look infinitely better (but take longer to process) than one created on a EGA display. It's primary use is to provide a "Screen dump" type facility and to provide full 256 color PostScript output. The output is automatically scaled to fit a 8.5 x 11 sheet. The default orientation is potrait which may be altered to landscape using the "Rotate plots" switch. The calling syntax is : SLD2PS The options available are: -E: Generate Encapsulated PostScript file -C: Output Full color Postscript -R: Rotate plots to landscape orientation -?: Print help message These may be input in any order & combination and must be separated by spaces. Examples: SLD2PS chroma ... Dump CHROMA.SLD to PostScript SLD2PS -R chroma ... Rotate plot to landscape orientation SLD2PS -C chroma ... Output full PostScript color information SLD2PS -E -R chroma ... Encapsulated PostScript output, rotate plots ADI2PS This utility postprocesses a Binary ADI plot file into a PostScript or Encapsulated PostScript file. Its primary use is to output line width information to a PostScript file. AutoCAD & AutoSketch currently treat a PostScript device as a single pen plotting device, and as a consequence one cannot assign line widths to a "logical" pen number. ADI2PS overcomes this limitation. The calling syntax is: ADI2PS Valid options are: -R for Reconfiguring -C to output a C size Bounding Box -E for Encapsulated PostScript output -? to print help message When ADI2PS is fired up, it looks for a file called PEN.CFG in the current directory. If this file is not found, the program leads you through the full configuration process which involves assigning a pen width to each of the 16 pens. This configuration information may be updated at any time by using the "-R" switch to reconfigure the program. In order to use this program, configure AutoCAD for an ADI plotter, outputting a Binary ADI plot file. The number of steps in the X & Y direction should be 300 [which is the resolution of most PostScript devices]. This may be done by following these steps: Select Configure AutoCAD from AutoCAD's Main Menu Select Configure plotter from the Configuration menu Select Autodesk Device Interface from the list of available plotters Select Binary file from the list of output formats available Answer Y to the question "Does your plotter have multiple pens? " Answer 16 to the question "How many pens does it have: " Answer N to the question "Does it have multiple dashed line styles? " Answer N to the question "Is the plotter variable speed" Answer N to the question "Specify plot size in millimeters" Enter a value to the question "Maximum horizontal (X) plot size" eg. 11 Answer 300 to the question "Plotter steps per inch in the (X) direction" Enter a value to the question "Maximum vertical (Y) plot size" eg. 8.5 Answer 300 to the question "Plotter steps per inch in the (Y) direction" The rest of the dialogue is the standard AutoCAD plot dialogue. Select the desired size units, plot origin, paper size, rotating plots option, adjust area fill option, removal of hidden lines option, and plot scale. Configure ADI2PS by simply running it if the PEN.CFG file is not present, or by using the -R switch to reconfigure it. The dialog issued during configuration is self-explanatory. Remember that the pen width is specified in PostScript Units !!! Thus the value selected specifies the width of a vector drawn using that pen number in multiples of 1/72 inch. Use the AutoCAD PLOT command to create a .plt file. Shell out to DOS and run ADI2PS. This step creates either a .ps or a .eps file. Copy this file to the printer by using the DOS COPY command to the port to which the PostScript device is connected e.g. copy test.ps lpt1: I hope you find these utilities useful. Some of the "features" not implemented and mentioned in the documentation above are rather interesting but one has run out of time for now. An important note: This is NOT an Autodesk product and the company itself has little to do with these utilities beyond providing the inspiration for the same. You can reach me by sending a message to Hans c/o "*SYSOP" on Autodesk's CompuServe Forum (GO ADESK) or by sending mail over UUCP {sun!acad!hans}. You cannot reach me over the phone unless you are an Authorized Autodesk dealer in which case you can call the Autodesk Dealer Support number. .... Amar Hanspal, Jan '89. ("The Code Cutter of Calcutta") Autodesk Inc. 2320 Marinship Way Sausalito, CA 94965