Skip to content

Desk Top Publishing on the Cheap

Vector 8:2, page 130

graphics system interfaces

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 130

After some considerable trouble (and after fruitless consultations with STSC and GSS) I have finally succeeded in importing graphics created by GSS drivers into Microsoft Word version 5.0. My approach takes account of the fact that I use a Hewlett Packard Laserjet but the principle should hold for most popular printers.

Before I fully explain the very simple procedure, I’ll give you a brief description of what not to do.

Firstly, you might logically assume that the best way to export graphics is to use Computer Graphics Metafiles (CGM files). APL*PLUS PC & APL*PLUS II both supply the metafile driver META.SYS which to quote the GSS Manual ‘manages metafiles, the computer graphics picture exchange and storage medium.’ Wonderful stuff, but Microsoft Word 5.0 doesn’t support metafiles. (I have used metafiles with WordPerfect and Harvard Graphics, but since I am obliged to use Word 5.0 I was forced to halt my research into metafiles. Word for Windows also supports the import of metafiles, although it does take a short while to convert the metafile to a readable format.)

The second approach I used was to save the charts to a HPGL plotter file using the GSS driver HPGLPLTR.SYS. The GSS Manual tells you that to write a graphic to a file, you need to type the following commands at the DOS prompt:

SET PLOTTER=HPGLPLTR
SET HPGLPLTR=<filename>

Obviously you need also to include the HPGL driver in your CONFIG.SYS or (more conveniently) in the GSS configuration file CGI.CFG. I discovered that my machine also required ‘SET FLAGGING=XONOFF’ to communicate properly with the plotter (possibly due to the fact that I didn’t have a plotter connected!). In order to avoid problems with filling the DOS environment space and also to avoid conflict with the contents of the GSS configuration file, I found it best to include the two commands above in CGI.CFG. Further tweaking can be done by reference to the GSS manual.

This method works in so much as it writes the graphic to a HPGL plotter file and Word 5.0 can interpret and print this on a Hewlett Packard laserjet printer. However the file created can be well over one megabyte in size for even a fairly simple chart and although Word was capable of printing a chart on its own, as soon as any text was added the printer would misbehave - printing charts and text on different pages in spite of the page layout and also printing gibberish.

At this stage I was forced to refer once more to the GSS manual. (I bought my manual direct from America before STSC started to include the manual with APL*PLUS and consequently it contains descriptions of all of the GSS drivers rather than the select few that STSC supply.) This fact is important because the complete manual has details of the alternative Laserjet printer driver HPLASERP.SYS. This not only produces better quality output (especially at 300 dpi resolution) but more importantly offers the option of printing to a file. Unfortunately this file comes on the GSS Completer Kit which costs around £100 but you do receive all sorts of other drivers and font files (which I’ve still not worked out how to use!).

The output from the driver HPLASERP.SYS can be redirected to file by inserting ‘HPLASERP=<filename>’ into CGI.CFG. It is important to restrict the number of rows per page using ‘PAGELENGTH=<rows per page>’ if you wish to put Word text on the same page as an imported graphic. The option ‘FF=’ must be set to ‘OFF’ if you wish to type text after a graphic.

At this stage I discovered that the print file contains an escape sequence which makes the graphic start on a new page. The only way around this seems to be to delete the escape sequence in APL. This can be easily identified and removed in APL (treating the print file as a native file and reading its contents as a vector in APL) by reference to your printer manual. (The format of print files are very easy for an experienced APLer!)

The resulting print file can be imported into Word and although the graphic cannot be previewed or resized in Word (since it only has a recognisable form when printed) the preview option can be used to gauge the spacing and layout of a document. The option of whether to print to a file or to the printer cannot be interactively reset inside an APL session. I have got around this problem by having two GSS configuration files and using ⎕CMD to overwrite CGI.CFG as required.

This method is a cheap and fairly efficient way of doing desk top publishing. Its major weaknesses are that the graphic cannot be viewed in Word and any resizing must be done in APL. This approach is useful to the NUFM Economics department because we have as a standard two main sizes of charts, thus there is no desire to resize charts. Obviously it would be preferable to import a true graphic image but until Word supports metafiles or GSS extend their selection of drivers to produce say Lotus PIC format then this approach is extremely viable.