Introduction
PostScript printer
:::: TYPES OF POSTSCRIPT
:::: CONVERTING POSTSCRIPT FILES
:::: CHANGING THE LAYOUT OF POSTSCRIPT FILES
:::: SPLITTING POSTSCRIPT FILES
:::: OTHER CHANGES TO POSTSCRIPT FILES
:::: CHANGING APPEARANCE
:::: CONVERTING IMAGES TO POSTSCRIPT
PaintJet printer
LaserJet printer
Windows .BMP files
GIF Files for World Wide Web and Other Applications
DigImage Raw Files
DigImage Compressed Files
Saving images for later conversion by DigiFile
Index
This section deals with features of DigiFile designed specifically to support PostScript output. In general PostScript is the preferred method of obtaining hardcopy output.
If you do not have a PostScript printer, or have a non-PostScript colour printer you wish to use, it may be possible to print the PostScript on this device using GhostScript, a Freeware application emulating PostScript and capable of driving a range of printers as well as providing on-screen rendering of PostScript files. This may be obtained from a wide variety of sources, including ftp://ftp.cs.wisc.edu/ghost/aladdin/ . The helper application GSView, a GhostView clone, is also Freeware and obtainable from ftp://ftp.cs.wisc.edu/ghost/rjl/ . GSView provides a much friendlier interface for interactive viewing of PostScript files. Both applications are also available over the world wide web at http://www.cs.wisc.edu/ ~ghost/.
There are two common forms of PostScript files: printable PostScript and encapsulated PostScript. By convention these are normally given the extensions .PS and .EPS respectively. As the name suggests, a printable PostScript (.PS) file will be printed if you send it to a suitable PostScript printer. It contains everything required to produce the final page or pages of text and/or graphics. In contrast, if you send an encapsulated PostScript (.EPS) file to the same printer, you should not get anything out of it. Encapsulated PostScript is intended as a method of importing the text or graphics it describes into another document or application. The .EPS file is responsible for drawing its contents in the printer's memory, but the document containing it is responsible for printing it where it wants and at the size it requires.
Ultimately the encapsulated (.EPS) form is more flexible and more useful. As a result we would recommend that you use it in preference to the .PS form. To enable you to print a DigImage .EPS file directly without importing it into some other application, the DigiFile utility offers the ability to convert the file to a .PS and send it directly to the printer. Note that DigImage can also convert .PS files (provided they were created by DigImage version 1.4 or later) into .EPS files.
DigImage also handles a third, nonstandard form of PostScript: Data only PostScript, .DPS. A .DPS file contains only the data required for the plotting and not the normal prolog of procedures. The main purpose of this form is to provide a more compact representation of the plot. With some document systems it is possible to include the prologue once and only once, no matter how many plots are used in the document. Unfortunately with others the prolog must be included with every plot. In the former case the .DPS form may be used to save a considerable amount of space and speed up printing, while in the latter case the .EPS form must be used. DigiFile is able to convert it to either the .PS or .EPS forms. It is not, however, possible to convert .PS or .EPS into .DPS.
Which type of PostScript is produced by the output of DigiPlot and DigiFile will normally be determined by the extension given to the output file. Printable PostScript is produced if .PS is specified, encapsulated PostScript is generated with the .EPS extension and data only PostScript with the .DPS extension. If no extension is specified, the type of PostScript is determined by the setting in [;P Printers] in CONFIGUR.EXE. The appropriate extension will be added automatically. Any other extension will also produce PostScript of the default type (but using the specified extension).
The features of DigiFile specific to handling and creating PostScript files are outlined in the following three sections. Further details on how to create PostScript may be found in the DigiPlot documentation.
DigiFile may be used to convert PostScript files generated by DigImage (version 1.4 or later) between their encapsulated (.EPS) and printable (.PS) forms. Data only PostScript (.DPS) can also be converted to .PS or .EPS, but not vice versa. The command line to convert a file is
C:..> DIGIFILE postscript_file /FP [output_file] [/PT tray]
where the file will be sent to output_file. The type (.PS or .EPS) of the resulting file is determined by the extension specified. If no output_file is specified, then the file is converted to its .PS form and sent to the printer.
The optional /PT
tray switch may be used to specify the paper tray from which the
media will be taken in the printer. Details are given in the table
below.
| Switch | Effect |
| /FP [output_file] | This switch may be used to direct the PostScript to a specified file rather than sending it directly to the printer. |
| /PT tray | If included, then this switch will select a specific source for the paper. Valid values of tray are:0 Manual feed
1 "Upper" tray 2 "Lower" trayNote that on some PostScript printers the upper and lower trays may be reversed. Once included, it is not possible for DigiFile to remove the paper tray selection from the PostScript file. |
The layout (how many sub-plots per page) of a DigImage PostScript file may be changed using DigiFile. To enhance this ability, it is also possible to concatentate two or more PostScript files. The command line for this is
C:..> DIGIFILE postscript_file /FP output_file /N plot_format [/A]
The /N plot_format switch has the same effect as its counterpart in DigiPlot, viz.
| plot_format | |
| 0 | One plot per page, portrait |
| 1 | One plot per page, landscape (default) |
| 2 | Two plots per page, portrait |
| 3 | Three plots per page, portrait |
| 4 | Four plots per page, landscape |
| 10 | As for 0 but with space for alternate x and y axes |
| 11 | As for 1 but with space for alternate x and y axes |
| 12 | As for 2 but with space for alternate x and y axes |
| 13 | As for 3 but with space for alternate x and y axes |
| 14 | As for 4 but with space for alternate x and y axes |
If the output_file already exists, then the new postscript_file may be appended to it by including the /A switch. If the /A switch is not specified, any previous output_file will be overwritten. It is not possible to send the PostScript directly to the printer if the /A switch is specified.
Note the /PT switch is also available when changing the layout. It is not, however, possible for DigiFile to subsequently remove the effect of this switch.
Sometimes it is desirable to split a PostScript file containing more than one plot to recover the individual plots. This can be achieved with
C:..> DIGIFILE postscript_file /FP output_file /E page [/N
plot_format]
where page is the page/plot number to be extracted. The /N plot_format switch may be used in conjunction with /E page to reformat the plot at the same time. Note this will only work for PostScript files created by DigImage version 1.4 or later.
DigiFile may also be used to alter other aspects
of an existing PostScript file.
A complete list of the options (including those given in the sections
above) is given in the table below.
| Switch | Effect |
| /FP [output_file] | This switch may be used to direct the PostScript to a specified file rather than sending it directly to the printer. |
| /C colour_model | This switch specifies how colour and greyscale information will be printed. The default colour_model is specified by the [;P Printers] option in the configuration utility CONFIGUR.EXE. If you are using a Level 1 PostScript printer, then only colour_models 0 and 1 are available. For a Level 2 colour PostScript printer the basic response to the different colour models is:0 Colour information not used. DigiPlot lines are rendered as dashed line types while images are rendered as greyscale.1 DigiPlot lines are rendered as greyscale as are images.2 DigiPlot lines and images rendered as colour.3 Images rendered as colours and lines as dashes.10 As for /C 0, but remaps the intensity using the active lookup table as specified by /O. DigiFile will send the result to the greyscale printer, although will be printed in colour if sent directly to a colour printer.11 As for /C 1, but remaps the intensity using the active lookup table as specified by /O. DigiFile will send the result to the greyscale printer, although will be printed in colour if sent directly to a colour printer.With a Level 2 greyscale printer, the colour information will be rendered using the equivalent intensity. |
| /PT tray | If included, then this switch will select a specific source for the paper. Valid values of tray are:0 Manual feed
1 "Upper" tray 2 "Lower" trayNote that on some PostScript printers the upper and lower trays may be reversed. |
| /N plot_format | Specifies the format of the plots. The valid values of plot_format are:0 One plot per page, portrait
1 One plot per page, landscape (default) 2 Two plots per page, portrait 3 Three plots per page, portrait 4 Four plots per page, landscape 10 As for 0 but with space for alternate x and y axes 11 As for 1 but with space for alternate x and y axes 12 As for 2 but with space for alternate x and y axes 13 As for 3 but with space for alternate x and y axes 14 As for 4 but with space for alternate x and y axesNote that this switch does not affect the appearance of the plot on the screen. |
| /E page | Extract the specified page from the source file. |
| /A | Appends the image to the output_file if the latter already exists. |
| /U [section] use_file | Adds some or all of the specified PostScript file use_file to the output. The file is added just before the %%EndPageSetup statement for each page in the output. If the optional section is given, then only the section of use_file starting from the line beginning after .section (e.g. .10), and finishing before the next line starting with a dot, will be added to the output. For more information, refer to the documentation for the GraphicsPrependFile subroutine. If section is not specified, then the entire file is added.Up to ten files or sections within a file may be added in this way using ten occurrences of the /U switch..A typical use of this option is to change the rendering of scalar fields by Trk2DVel from greyscale to cross-hatch patterns by including the file Patterns.PS with this switch. Refer to section 2.6 for details. |
| /# nCopies | Specifies the number of copies of the image to be printed |
In addition to the methods described in the preceeding sections, the appearance of the PostScript output may be altered reterospectively by utilising the /U use_file option in DigiFile. This option inserts the specified use_file at the start of the PostScript describing each page. The contents of the use_file may be used to override the standard DigImage procedures defined in the Header.PS and GraphVDU.PS prologue files, or even redefine standard PostScript procedures. For DigiPlot output the same net effect may be achieved through W or WF plot instructions, but in a manner which is less convenient for most users.
Development of use_files
requires a reasonable working knowledge of PostScript. From time-to-time
specialised use_files
will be released with DigImage. A list of these files is given
below:
| Switch | Description |
| /u Patterns.PS | Renders images and grey-scale fills as cross hatched patterns. This has been applied to both images and the scalar field produced by Trk2DVel gridded velocity fiels. |
| /u 10 Use_Titl.PS | Suppresses main graph titles. |
| /u 20 Use_Titl.PS | Suppresses all graph text. |
| /u 10 Use_Scal.PS | Suppress scales for velocity and scalar field. |
| /u 20 Use_Scal.PS | Reposition scale for scalar field within frame in top left quadrant. |
DigiFile may also be used to convert an image file to PostScript and either send it to a printer or a file. The command line for this is
C:..> DIGIFILE image_file /FP [output_file] [/W iw0 iw1 jw0 jw1]
[/NB bit_planes] [/C colour_model] [/G]
[/O output_lut] [/T title] [/D [buffer]]
[/PT tray] [/N plot_layout] [/A]
As with the PaintJet version, if the output_file is not specified, the PostScript image will be sent down the parallel printer port to the PostScript printer (if any) connected to it. If the printer is connected to a serial port or a remote computer, then you will need to use DigiFile to create a temporary PostScript file which will then need to be transferred to the printer using some appropriate (system dependent) method.
If the output_file has a .EPS extension, then the output file will be written as encapsulated PostScript. Similarly if output_file has a .DPS extension, then data only PostScript will be created.
The remaining options have some differences to those
for the PaintJet version and are detailed below:
| Switch | Effect |
| /W iw0 iw1 jw0 jw1 | This switch may be used to reduce the size of the window to be dumped to the printer. If not present, then the entire window contained in the file will be used. If the image file itself were saved as a window, then the top left corner of the image is loaded to coordinates 0,0 (not the original position of the window) and so the new sub-window coordinates should be relative to this. |
| /NB bit_planes | This switch sets the number of bit planes to be rendered on the printer. If not specified, then DigiFile will default to all eight bit planes. The number of bit planes is restricted by PostScript to 1, 2, 4 or 8. |
| /C colour_model | This switch specifies how colour and greyscale information will be printed. The default colour_model is specified by the [;P Printers] option in the configuration utility CONFIGUR.EXE. If you are using a Level 1 PostScript printer, then only colour_models 0 and 1 are available. For a Level 2 colour PostScript printer the basic response to the different colour models is:0 Colour information not used. DigiPlot lines are rendered as dashed line types while images are rendered as greyscale.1 DigiPlot lines are rendered as greyscale as are images.2 DigiPlot lines and images rendered as colour.3 Images rendered as colours and lines as dashes.With a Level 2 greyscale printer, the colour information will be rendered using the equivalent intensity. |
| /G | If neither /C 0 is utilised, then the intensities will be used directly to determine the grey level in the PostScript. However, if /G specified, the intensities will be used to determine the red, green and blue components of the false colour associated with each pixel. These components will then be combined to give a grey level determined from 0.30red + 0.59green + 0.11blue. This gives an equivalent intensity for a colour image, enabling nominally full coloured images to be rendered appropriately in the grey-scale PostScript. |
| /O output_lut | Specifies the output look up table to be used for rendering the image if either the /C or /G switches is specified. |
| /T title | Specify title for plot. The text included after the /T switch up until the end of the line or the next / character is printed out below the screen dump. The title may include character formatting using the following codes:&R Switch to Roman font (default)
&I Switch to Italic font &G Switch to Greek font &N or &- Switch to normal size (default) &H or &^ Switch to superscript &L or &_ Switch to subscript &S Switch to small size &A Switch to normal weight (default) &B Switch to bold && The ampersand (&) symbol. |
| /D [buffer] | If the /D switch is included by itself, then the image, once loaded, will be displayed on the computer monitor. If buffer is also included, then the image will be displayed on the frame grabber monitor using the specified buffer number. Note that this last option is the only one for which DigiFile requires the frame grabber card to be installed. |
| /PT tray | If included, then this switch will select a specific source for the paper. Valid values of tray are:0 Manual feed
1 "Upper" tray 2 "Lower" trayNote that on some PostScript printers the upper and lower trays may be reversed. |
| /N plot_format | Specifies the format of the plots. The valid values of plot_format are:0 One plot per page, portrait
1 One plot per page, landscape (default) 2 Two plots per page, portrait 3 Three plots per page, portrait 4 Four plots per page, landscape 10 As for 0 but with space for alternate x and y axes 11 As for 1 but with space for alternate x and y axes 12 As for 2 but with space for alternate x and y axes 13 As for 3 but with space for alternate x and y axes 14 As for 4 but with space for alternate x and y axesNote that this switch does not affect the appearance of the plot on the screen. |
| /A | Appends the image to the output_file if the latter already exists. |
| /# nCopies | Specifies the number of copies of the image to be printed |
Often a more realistic looking image may be produced by bypassing
the grey scale rendering used by PostScript. Refer to the end
of section 4 on
LaserJet printers for more details.
DigImage documentation page
DigImage home page
Stuart Dalziel's home page