logo TRIUMF Annual Report
Scientific Activities 1999
Figures Post Mortem


The following table and links describe the PostScript editing that was required in order to be able to use the submitted Encapsulated PostScript (EPS) figure files in the TRIUMF Annual Report Scientific Activities 1999.

Please look at the entries relating to the figures which you submitted last year and try to correct any problems before submitting similar files for the 2000 Annual Report.


Return to the Figures Post Mortem Page

Return to the TRIUMF Annual Report Scientific Activities Home Page


Summary of Problems Encountered
Figure Software Package Used Problem(s) PostScript Editing
Site CorelDRAW 9   None
1 TRIUMF Graphics   None
2 TRIUMF Graphics   None
3 TRIUMF Graphics   None
4 TRIUMF Graphics Linewidths Change linewidths 3»2
5 TRIUMF Graphics Linewidths Change linewidths 4»2
6 ?, PSCRIPT.DRV V4.0 Frame , Heading , Whiteout , Bounding box Remove frame , Change heading , Suppress whiteout , Remove white fill , ps2epsi , Trial & error
7 ?, PSCRIPT.DRV V4.0 Frame , Whiteout , Bounding box Remove frame , Suppress whiteout , Remove white fill , ps2epsi
8 TRIUMF Graphics Linewidths Change linewidths 1,3,6»2
9 HIGZ V1.25/05 Frame , Heading , Whiteout , Bounding box Remove frame , Change heading , Remove white fill , ps2epsi
10 HIGZ V1.23/09 Bounding box ps2epsi
11 HIGZ V1.23/09 Bounding box ps2epsi
12 HIGZ V1.23/07 Preview , Colours Strip preview code , Change colours
13 CorelDRAW, Windows PSCRIPT Bounding box ps2epsi
14 GraphicConverter, LaserWriter 8 8.6.5 Printer setup , Bounding box Suppress printer setup , ps2epsi , Trial & error
15 Acrobat Reader 4.0, LaserWriter 8 8.6.5 Printer setup , Bounding box Suppress printer setup , ps2epsi
16 EPSEFactory V1.0 Bounding box ps2epsi
17 EPSEFactory V1.0 Bounding box ps2epsi
18 HIGZ V1.23/09   None
19 CorelDRAW 8 Bounding box ps2epsi
20 CorelDRAW 8   None
21 EPSEFactory V1.0 Bounding box ps2epsi
22 HIGZ V1.23/09 Bounding box ps2epsi
23 HIGZ, ps2epsi? Preview Strip preview code
24 HIGZ, ps2epsi? Preview Strip preview code
25 HIGZ, ps2epsi? Preview Strip preview code
26 Adobe Illustrator 8.0 Bounding box ps2epsi , Trial & error
27 Adobe Illustrator 8.0 Bounding box ps2epsi , Trial & error
28 XV V3.10   None
29 XV V3.10 Cropping Scanned image
30 XV V3.10   None
31 AutoCAD PSOUT Bounding box ps2epsi
32 TRIUMF Graphics Linewidths Change linewidths 1»2
33 TRIUMF Graphics Linewidths Change linewidths 1»2
34 TRIUMF Graphics   None
35 TRIUMF Graphics   None
36 fig2dev V3.1 P1   None
37 TRIUMF Graphics Linewidths Change linewidths 3»2
38 TRIUMF Graphics Linewidths Change linewidths 1»2
39 TRIUMF Graphics Linewidths Change linewidths 1»2
40 TRIUMF Graphics Linewidths Change linewidths 1»2
41 TRIUMF Graphics Linewidths Change linewidths 1»2
42 TRIUMF Graphics   None
43 TRIUMF Graphics Linewidths Change linewidths 6»2
44 TRIUMF Graphics Linewidths Change linewidths 4»2
45 TRIUMF Graphics Linewidths Change linewidths 2,4,5»2
46 TRIUMF Graphics Linewidths Change linewidths 4»2
47 TRIUMF Graphics   None
48 TRIUMF Graphics   None
49 TRIUMF Graphics   None
50 TRIUMF Graphics Linewidths Change linewidths 1»2
51 TRIUMF Graphics   None
52 TRIUMF Graphics   None
53 TRIUMF Graphics   None
54 TRIUMF Graphics   None
55 TRIUMF Graphics Linewidths Change linewidths 1»2
56 TRIUMF Graphics Linewidths Change linewidths 1»2
57 TRIUMF Graphics Linewidths Change linewidths 4,5,8,10»2
58 TRIUMF Graphics Linewidths Change linewidths 1,4,5,8,10»2
59 HIGZ V1.23/09 Bounding box ps2epsi
60 HIGZ V1.23/09 Bounding box ps2epsi
61 HIGZ V1.23/09 Bounding box ps2epsi
62 TRIUMF Graphics Colours Change colours
63 Grace-5.0.5 (gamma)   None
64 TRIUMF Graphics Linewidths Change linewidths 3»2
65 TRIUMF Graphics Linewidths Change linewidths 3»2
66 TRIUMF Graphics Linewidths Change linewidths 3»2
67 TRIUMF Graphics Linewidths Change linewidths 3»2
68 Axum for Windows Bounding box ps2epsi
69 Axum for Windows Bounding box ps2epsi
70 Axum for Windows Bounding box ps2epsi
71 TRIUMF Graphics   None
72 TRIUMF Graphics   None
73 Axum for Windows Bounding box ps2epsi
74 PSCRIPT.DRV V4.0 Printer setup , Whiteout Suppress printer setup , Suppress whiteout
75 TRIUMF Graphics Linewidths Change linewidths 2»1
76 TRIUMF Graphics Linewidths Change linewidths 3»2
77 TRIUMF Graphics   None
78 ADOBEPS4.DRV V4.10 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi , Trial & error
79 ADOBEPS4.DRV V4.10 Printer setup , Whiteout Suppress printer setup , Suppress whiteout
80 Adobe Illustrator 7.0 Whiteout , Bounding box Remove white fill , ps2epsi
81 TRIUMF Graphics Linewidths Change linewidths 5»2
82 PSCRIPT.DRV V4.0 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
83 Adobe Illustrator 7.0 Whiteout , Bounding box Remove white fill , ps2epsi , Trial & error
84 ADOBEPS4.DRV V4.10 Printer setup , Whiteout Suppress printer setup , Suppress whiteout
85 Ghostscript ps2epsi Preview , Linewidths Strip preview code , Change linewidths 3»2
86 Ghostscript ps2epsi Preview , Linewidths Strip preview code , Change linewidths 3»2
87 TRIUMF Graphics   None
88 TRIUMF Graphics   None
89 TRIUMF Graphics   None
90 gnuplot V3.7 PL0 Bounding box ps2epsi
91 Windows NT 4.0 Cannot view/print , Printer setup , Bounding box Head & tail , Suppress printer setup , ps2epsi
92 Windows NT 4.0 Cannot view/print , Printer setup , Bounding box Head & tail , Suppress printer setup , ps2epsi
93 TRIUMF Graphics   None
94 TRIUMF Graphics   None
95 PGPLOT   None
96 PGPLOT   None
97 PGPLOT   None
98 XV V3.10   None
99 XV V3.10 Cropping , Bounding box Scanned image , ps2epsi
100 MS PowerPoint, ADOBEPS4.DRV V4.24 Printer setup , Whiteout , Bounding box Suppress printer setup , Suppress whiteout , ps2epsi
101 AutoCAD PSOUT Bounding box ps2epsi , Trial & error
102 TRIUMF Graphics Linewidths Change linewidths 1»2
103 TRIUMF Graphics Linewidths Change linewidths 5»2
104 CorelDRAW 8   None
105 CorelDRAW 8   None
106 CorelDRAW 8   None
107 CorelDRAW 8   None
108 CorelDRAW 8   None
109 LEXPS V4.29 Bounding box ps2epsi
110 TRIUMF Graphics Linewidths Change linewidths 3»2
111 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1 Bounding box ps2epsi
112 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1 Bounding box ps2epsi
113 Freelance Graphics, Adobe Printer Driver 3.0 for Windows 3.1 Bounding box ps2epsi
114 TRIUMF Graphics Linewidths Change linewidths 2»0.5
115 TRIUMF Graphics   None
116 MS Excel, PSCRIPT.DRV V4.0 CTRL D , Printer setup , Whiteout , Bounding box EOF , Suppress printer setup , Suppress whiteout , Remove white fill , ps2epsi
117 MS Excel, PSCRIPT.DRV V4.0 CTRL D , Printer setup , Whiteout , Bounding box EOF , Suppress printer setup , Suppress whiteout , Remove white fill , ps2epsi
118 MS Excel, PSCRIPT.DRV V4.0 CTRL D , Printer setup , Whiteout , Bounding box EOF , Suppress printer setup , Suppress whiteout , Remove white fill , ps2epsi
119 TRIUMF Graphics   None
120 JPG, XV V3.10 Cropping Scanned image
121 Kaleidagraph, MS Word, PSPrinter 8.3.1 Preview , Printer setup , Bounding box Strip preview code , Suppress printer setup , ps2epsi
122 Kaleidagraph, MS Word, PSPrinter 8.3.1 Preview , Printer setup , Bounding box Strip preview code , Suppress printer setup , ps2epsi
123 JPG, XV V3.10   None
124 MS Excel, LaserWriter 8 8.6.5 Printer setup , Bounding box Suppress printer setup , ps2epsi , Trial & error
125 MS Excel, LaserWriter 8 8.6.5 Printer setup , Bounding box Suppress printer setup , ps2epsi , Trial & error
126 JPG, XV V3.10   None
127 JPG, XV V3.10   None
128 TRIUMF Graphics Spurious , Colours , Linewidths , Bounding box Remove spurious item , Change colours , Change linewidths 4»2 , ps2epsi
129 TRIUMF Graphics   None
130 TRIUMF Graphics   None
131 TRIUMF Graphics   None
132 TRIUMF Graphics   None
133 TRIUMF Graphics   None
134 TRIUMF Graphics Spurious , Bounding box Remove spurious item , ps2epsi
135 TRIUMF Graphics Spurious , Bounding box Remove spurious item , ps2epsi
136 TRIUMF Graphics Colours Change colours
137 TRIUMF Graphics   None
138 TRIUMF Graphics Colours Change colours
139 TRIUMF Graphics   None
140 TRIUMF Graphics   None
141 TRIUMF Graphics   None
142 TRIUMF Graphics   None
143 TRIUMF Graphics Colours Change colours
144 TRIUMF Graphics   None
145 TRIUMF Graphics   None
146 TRIUMF Graphics Colours Change colours
147 TRIUMF Graphics Colours Change colours
148 TRIUMF Graphics   None
149 TRIUMF Graphics   None
150 TRIUMF Graphics Spurious , Colours , Bounding box Remove spurious item , Change colours , ps2epsi
151 TRIUMF Graphics   None
152 TRIUMF Graphics   None
153 TRIUMF Graphics   None
154 TRIUMF Graphics Colours Change colours
155 TRIUMF Graphics Colours Change colours
156 TRIUMF Graphics   None
157 TRIUMF Graphics Colours Change colours
158 Quattro Pro, PSCRIPT.DRV V4.0 Cannot view/print , CTRL D , Printer setup , Whiteout , Frame , Heading , Bounding box Head & tail , EOF , Suppress printer setup , Suppress whiteout , Remove white fill , Remove frame , Change heading , ps2epsi
159 Quattro Pro, PSCRIPT.DRV V4.0 Cannot view/print , CTRL D , Printer setup , Whiteout , Captions , Bounding box Head & tail , EOF , Suppress printer setup , Suppress whiteout , Remove white fill , Change captions , ps2epsi
160 Quattro Pro, PSCRIPT.DRV V4.0 Cannot view/print , CTRL D , Printer setup , Whiteout , Frame , Heading , Bounding box Head & tail , EOF , Suppress printer setup , Suppress whiteout , Remove white fill , Remove frame , Change heading , ps2epsi
161 Quattro Pro, PSCRIPT.DRV V4.0 Cannot view/print , CTRL D , Printer setup , Whiteout , Frame , Heading , Captions , Bounding box Head & tail , EOF , Suppress printer setup , Suppress whiteout , Remove white fill , Remove frame , Change heading , Change captions , ps2epsi
162 JPG, XV V3.10   None
163 JPG, XV V3.10   None
164 JPG, XV V3.10   None
165 JPG, XV V3.10 Cropping Scanned image
166 GIF, XV V3.10   None
167 GIF, XV V3.10   None
168 Tgif-2.16-p9 Cannot view/print , Bounding box Head & tail , ps2epsi
169 JPG, XV V3.10   None
170 JPG, XV V3.10   None
171 GIF, XV V3.10 Cropping Scanned image
172 JPG, XV V3.10   None
173 JPG, XV V3.10   None
174 JPG, XV V3.10 Cropping Scanned image
175 PDF, Windows NT 4.0 Frame , Heading , Captions , Bounding box Remove frame , Change heading , Change captions , ps2epsi
176 PDF, Windows NT 4.0 Frame , Heading , Captions , Position , Whiteout , Bounding box Remove frame , Change heading , Change captions , Change position , Remove white fill , ps2epsi , Trial & error
177 PDF, Windows NT 4.0 Frame , Heading , Captions , Position , Whiteout , Bounding box Remove frame , Change heading , Change captions , Change position , Remove white fill , ps2epsi
178 PDF, Windows NT 4.0 Frame , Heading , Captions , Bounding box Remove frame , Change heading , Change captions , ps2epsi
179 JPG, XV V3.10   None
180 JPG, XV V3.10   None

| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


Description of Problems and Solutions
Problem PostScript Editing Solution
Cannot view/print
The figure cannot be viewed using Ghostview or Ghostscript and cannot be printed.
Head & tail
Problem:
Inability to view or print is caused by the existence of unwanted lines at the head of the file, or unwanted characters at the beginning of the first line, and unwanted lines appended at the end of the file.

Often the lines at the head and tail of the file correspond to escape sequences which are sent to the printer to explicitly force it into and out of PostScript printing mode.

Solution:
The first line of the file must begin with %!PS-Adobe-...

Strip off any lines above this, or any characters before it on the first line.

The file should end with %%EOF (or %%Trailer with perhaps valid lines in the trailer block).

Strip off any lines after this.

CorelDRAW EPS head & tail
Problem:
Will not view using Ghostview or Ghostscript. Will not print.

The problem is caused during the creation of the EPS file by CorelDRAW. Unwanted characters are inserted at the beginning of the first line and unwanted lines are appended at the end of the file.
(See below for instructions on how to avoid this problem.)

Solution:
Strip all unwanted characters off the first line of the file from the start of the file until %!PS-Adobe-... is reached.

Strip all unwanted lines off the tail of the file, starting after the line %%EOF until the end.

CAUTION: many of these lines are extremely long binary strings (may be 1 MB long) and editors tend to freeze if an attempt is made to go to the end of the file and start deleting backwards. Find the %%EOF line, move to the next line and then start deleting by word or line. Normally there are only about 5-50 lines of data to delete.

Real solution:
When saving to EPS format in CorelDRAW, using File Export, ensure that in the EPS Export window:

Export text as:
  is set to Text and the Include fonts box IS checked
NOT
  set to Curves.

Image header:
  The Include header box IS NOT checked.
(If checked, this produces the unwanted code at the head and tail of the file.)

Scan
Problem:
All attempts to edit submitted EPS file fail, or no electronic version of the figure exists.

Solution:
Scan, using Adobe Photoshop or similar package, and save as an EPS file.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

CTRL D
CTRL D character present at end of file. Causes viewing and printing problems.
EOF
Problem:
%%EOF line followed by CTRL D character. Caused by the software package used to create the EPS file or using the -F1 option in dvips.

Solution:
Delete the CTRL D character at the end of the file.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Printer setup
The file is not a true EPS file, but a PostScript file which contains explicit printer setup commands.
Suppress printer setup
Problem:
Explicit printer setup commands are contained in the
%%BeginSetup ... %%EndSetup
and/or
%%BeginPageSetup ... %%EndPageSetup
sections of the PostScript file which cause viewing and printing problems.

Solution:
Find the
%%BeginSetup ... %%EndSetup
and
%%BeginPageSetup ... %%EndPageSetup
sections of the file.

Look for sets of lines like:

%%BeginFeature: *OPTION
... (SETUP)
%%EndFeature

where *OPTION can be:

*PageSize US Letter
*Resolution 300dpi
*InputSlot AutoSelect Tray
*ManualFeed
*Duplex
etc.

Either delete or comment out each line corresponding to
... (SETUP)
(Comment out a line by placing a single % at the start of the line.)
Blank lines may be left as no printer setup is specified.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Whiteout
The software package used did not create a true EPS file, but a PostScript file where the image was placed on a full size page which was explicitly initialized with a white colour fill.
Suppress whiteout
Problem:
Almost all problems are due to the use of the Microsoft Windows PostScript Driver PSCRIPT.DRV.

The PostScript macro rf (often multiply defined in the various PostScript dictionaries in the file) is defined to execute a rectfill (rectangular fill) of the defined area (full US Letter or A4 page) in the defined colour (white).

Even if the bounding box values for the image are correct, when the scaled image is laid down on the page it still retains a white border corresponding to a whiteout area of a full US Letter or A4 page scaled down by the figure scaling factor. This whiteout area obliterates any underlying text or images which have already been defined in the PostScript file (text or images defined later in the file can overprint this whiteout area).

Solution:
Find the
%%BeginPageSetup ... %%EndPageSetup
section of the file and then the line

userdict begin /pagesave save def end mysetup concat colspRefresh : 1.000 1.000 1.000 sco 0 0 XXXX YYYY rf ;

where XXXX YYYY =

2550 3300 (300 dpi, US Letter, 8.5" x 11", portrait)
3300 2550 (300 dpi, US Letter, 8.5" x 11", landscape)
5100 6600 (600 dpi, US Letter, 8.5" x 11", portrait)
6600 5100 (600 dpi, US Letter, 8.5" x 11", landscape)
2480 3508 (300 dpi, A4, 210 mm x 297 mm, portrait)
etc.

Edit the line by replacing both XXXX and YYYY with 0.
(For safety, copy and comment out the original line first.)

Now the rf rectangular fill command is filling a zero area rectangle with white.

Re-run LaTeX2e and dvips to check that the whiteout problem has been solved. If it remains, check to see if code performing a white clip fill also exists in the file, as outlined below.

Remove white fill
Problem:
Clip area defined and filled with white before laying down a particular part of the image, obliterating any underlying text or images which have already been defined in the PostScript file. The clip area is often too large, especially if a frame has been removed, a heading changed, captions moved, or the position of image elements changed.

Solution:
Normally the offending code will be found at the start of the PostScript code which draws the particular part of the image.

Look for code such as:

xxxx yyyy N M XXXX YYYY rr : 1.000 1.000 1.000 sco O ;

which starts a newpath and moves to xxxx yyyy before defining a relative clip area of dimensions XXXX YYYY and performing a white fill. Edit the line by changing both XXXX and YYYY to 0.

Or look for code such as:

: 0 0 XXXX YYYY rc

which defines a rectangular relative clip area of dimensions XXXX YYYY and performs a white fill. Edit the line by changing both XXXX and YYYY to 0.

Or look for code which defines a newpath, moves to a point, defines a box by a series of four lines, and then performs a white fill using the F macro. In this case, comment out or delete these particular lines of code.

In each case, XXXX and YYYY are large numbers corresponding to the overall size of the image. There may be many instances of such strings of code in the file because many software packages clip and white fill areas before laying down each element. However, the offending set of code is normally at the head of the PostScript code defining the image.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Cropping
Whitespace around a scanned image needs to be cropped. Cannot use ps2epsi (see Warning).

Imperfections
Imperfections on a scanned image need removing.

Scanned image
Problem:
The file has been created by scanning an image or by conversion from another file format using a package such as XV. The image has unwanted features such as a frame, imperfections, or whitespace.

Solution:
If removing whitespace, edit the preamble defining the number of pixels in the horizontal and vertical directions, and then either remove the unwanted lines of hex code at the top and/or bottom of the image, or edit every line of hex code to remove pixels on the left or right.

Whitespace may be cropped using XV.

If removing unwanted lines or imperfections, edit the corresponding hex code for each scan line.

(NOTE: This procedure requires a detailed knowledge of the hex code syntax, which differs depending upon which software package was used to produce the image.)

Warning:
If the scanned image has unwanted whitespace around it, beware of merely using ps2epsi to find the correct bounding box values, editing the .eps file to insert the correct bounding box values, and then rescaling the image in the document. The white pixels forming the unwanted whitespace border will also be scaled and may overwrite any neighbouring text or images that have already been defined in the PostScript file. Therefore the steps outlined above should be followed in order to remove any unwanted whitespace from the image.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Spurious
Figure contains spurious dots or lines.
Remove spurious item
Problem:
A vector graphics figure contains spurious dots or lines.

Solution:
Comment out the relevant code.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Frame
The figure has an unwanted frame box drawn around it.
Remove frame
Problem:
The image has been produced with an unwanted frame box drawn around it.

Solution:
In the case of a scanned image file, the hex code of each affected scan line has to be edited, as described above.

For a vector graphics EPS file, the PostScript code defining the frame box lines has to be found and deleted, commented out, or modified. The code is normally near the head or tail of the PostScript code which defines the image.

Occasionally the frame box is drawn twice, so two sets of code have to be modified.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Heading
The figure includes an unwanted or incorrect heading, or other text.
Change heading
Problem:
The figure includes an unwanted heading which is duplicated in the figure caption, or an incorrect heading, or other unwanted or incorrect text.

Solution:
Find the relevant PostScript code (normally easy to find by searching for the actual words or fragments of the words) and either comment out (sometimes fails) or replace by null fields.

If the text needs changing, modify the relevant code. However, positioning problems may result if major modifications are made.

Some software packages do not use PostScript fonts for text, but draw a series of lines instead. These are far more difficult to edit, but sometimes the correct sections of code can be found and removed.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Captions
Incorrect or incorrectly positioned captions on graphs.
Change captions
Problem:
The captions on graphs are incorrectly labelled or are in the wrong position.

Solution:
As for headings, find the relevant code and alter the wording or positioning.

To alter the position of a part of the image, use the x y translate command before the relevant section of code, followed by a compensating translation in the opposite sense before the remainder of the code in the figure.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Position
Part(s) of an image are incorrectly positioned.
Change position
Problem:
Part(s) of an image are incorrectly positioned, either in the original figure or as a result of removing or adding text or other features.

Solution:
Reposition parts of an image using the x y translate command before the relevant section of code, followed by a compensating translation in the opposite sense before the remainder of the code in the figure.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Linewidths
The linewidths are too thick or too thin in the figure.
Change linewidths
Problem:
Some or all linewidths are too thick or too thin in the figure.

Solution:
Find the n setlinewidth command (or the corresponding macro command) for the relevant part of the image and alter the value of n. Some software packages assign global linewidths, others explicitly assign values for each set of line elements.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Colours
Colours need to be changed in the figure.
Change colours
Problem:
Colours need to be changed in the figure for some reason. In particular, pale colours such as yellow or cyan reproduce poorly when printed on monochrome laser printers. Lines, arrows and labelling should not use pale colours.

Solution:
Either change the colour completely or darken it by changing its RGB values to lower indices. For the standard primary colours change indices of 1 to 0.8.

Find and edit the r g b setrgbcolor values for the relevant parts of the image. Some software packages define global macros for a palette of colours, in which case only one set of rgb values has to be changed to alter all such instances of the colour in the image. Other software packages explicitly assign values for each set of line elements.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Clarity
The clarity of a scanned image is poor.
Sharpen JPG
Problem:
The clarity of a scanned image is poor and needs to be sharpened or blurred.

Solution:
Use a package such as XV or Adobe Photoshop to modify the appearance of the image.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Not EPS
Not a true EPS file but a PostScript file defining an image placed somewhere on a one page document.
LaTeX & dvips
Problem:
In many instances, PostScript files masquerading as EPS files can be used successfully in LaTeX2e documents, either unaltered or by using one of the fixes described in this table.

However, PostScript files that have been created by writing LaTeX code to place an image on a page, then running LaTeX2e and dvips to create a PostScript file, have the problem that they have incorrect bounding box values in the heading and embedded code specifying a full US Letter or A4 page size. Therefore the images will not scale properly. The irony is that a (perhaps) perfectly good EPS file had to be used to create an unusable PostScript file.

Solution:
If the original EPS figure file cannot be obtained, edit the PostScript file by stripping out all of the code after the %%BoundingBox: line in the heading until %%Page: 1 1 is reached.

Use the llx lly urx ury values in the @beginspecial command as the possibly correct bounding box values and edit the %%BoundingBox: line in the heading.

Then delete the code starting at %%Page: 1 1 until after the %%BeginDocument: line.

The PostScript code defining the image follows.

At the tail of the file, comment out the lines created by LaTeX2e and dvips and leave the %%Trailer and %%EOF lines and relevant code in the Trailer block.

View the file using Ghostview or Ghostscript to see if it works, and run ps2epsi to confirm the bounding box values.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Bounding box
The bounding box values specified for the figure are wrong and the image does not scale correctly.
ps2epsi
Problem:
Bounding box values wrong, image does not scale to column width correctly. Often too much white space around figure.

Solution:
Run the ps2epsi package to determine the correct bounding box values from the resulting .epsi file which is created (see the %%BoundingBox: line at the head of the file). Comment out the incorrect %%BoundingBox: line in the .eps file and insert the correct one (edit the .eps file rather than using the .epsi file because the .epsi file is larger due to the fact that it also includes a preview of the image).

Sometimes the ps2epsi package runs but produces an error message; the resulting .epsi file is not viewable. However, in many cases the bounding box values have been computed correctly and can be copied from the head of the file.

If ps2epsi fails completely, the bounding box must be determined via Trial and error.

ps2epsi also fails to calculate the urx coordinate correctly if an image created in landscape orientation was saved in portrait orientation. In this case urx=612 (8.5" in points) for US letter paper mode or urx=595 (210 mm in points) for A4 paper mode. Use Trial and error to find the correct coordinate value.

Warning:
After using ps2epsi and editing the .eps file, re-run LaTeX2e and dvips and then use Ghostview or Ghostscript to check that the image has scaled properly. In addition, ensure that neighbouring text or images have not been clipped by an extended whitespace around the image. See the instructions for how to suppress whiteout.

Trial & error
Problem:
ps2epsi or other solutions fail to determine the correct bounding box values.

Solution:
A good estimate can be gained by printing the .eps file, drawing a box around the image which just touches the outermost top, bottom, left and right pixels of the image, and then computing the coordinates of the lower left and upper righthand corners of the box to determine the llx, lly, urx, ury values in points (72 pt = 1 inch). The origin of the coordinate system is the lower lefthand corner of the paper.

Using Ghostview the llx, lly, urx, ury values can be determined by moving the cursor to the outermost left, bottom, right and top pixels of the image respectively and reading the relevant coordinate from the coordinate display box.

Edit the .eps file by inserting the new values in the %%BoundingBox: line, then view the resulting file using Ghostview or Ghostscript. If the bounding box is correct, the Ghostview or Ghostscript window will scale to exactly enclose the image. Edit the estimated values to correct for any whitespace or clipping.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |

Preview
The file contains image preview code.
Strip preview code
Problem:
The file contains image preview code inserted by the software package used to create the image when saving as an EPS file. The ps2epsi package also creates an image preview. While image previews are required by some wordprocessing packages such as MS Word, LaTeX2e and Ghostview ignore them and they take up unnecessary disk space and increase the download time to page viewers such as Ghostview.

Solution:
Strip out the unwanted code.


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


EPS file structure

Required comments:

%!PS-Adobe-x.0 EPSF-y.z       (x=1,2,3 ; y=1,2,3 ; z=0,1,2,...)
%%BoundingBox: llx lly urx ury

Recommended comments:

%%Title:
%%Creator:
%%CreationDate:
%%EndComments

Conditionally required comments:

%%Begin(End)Preview:
%%Extensions:
%%LanguageLevel:

Allowed comments:

%%DocumentNeededFonts
%%DocumentNeededResources

Illegal and restricted operators:

statusdict
userdict
clear
cleardictstack
initmatrix
setpagedevice
...

... PostScript code for image ...

showpage

%%Trailer

%%EOF


| TOP | Table | Problem | PostScript Editing Solution | EPS File Structure |


Return to the Figures Post Mortem Page

Return to the TRIUMF Annual Report Scientific Activities Home Page


For further assistance please contact:

TRIUMF Publications Office

Lorraine King - Thursdays and Fridays (09:30-14:00), and Sundays
(January to March only)
Jana Thomson - Wednesdays and Thursdays

E-mail: annrep@triumf.ca

Phone: 604-222-7427
FAX: 604-222-1074

Last modified: Mon Feb 5 14:14:42 PST 2001 by Martin Comyn

Visitors since 20-DEC-2000