[comp.lang.postscript] Problem with Chem3D

jan@imagen.UUCP (Jan Stoeckenius) (08/03/90)

There is a problem in the PostScript header provided for the
Chem3D package produced by Cambridge Scientific Computing. This
problem causes all files printed on a "long-edge-feed" printer
to give an "undefinedresult" error. This affects QMS PS2200,
QMS/Imagen ImageServer XP x320 series, various products based on
the DataProduct 2600 printer, and undoubtedly some others that
I am not aware of; in all cases only "small" paper sizes are affected
(letter, a4, b5).

The header contains the following code, defining a resolution
specific screen frequency:

    /pF 4.5 0 C defaultmatrix dtransform p D 9. d round d def

Loosely translated into full-text PostScript, this reads:

    /pF
      4.5 0                 % A vector in the x direction in user space
      matrix defaultmatrix  % Get the default transfromation for
                            %  this device/paper size combination
      dtransform            % Convert to device space
      pop dup               % Disgard second component, duplicate the first
      9.0 div round div     % Divide by 9, round to nearest integer
                            %  and divide back into the original number
      def

This code creates a screen frequency as close to 9 as possible while
retaining a cell size (at 0 degrees) that is a multiple of 16 pixels.

The difficulty is that only the first component of the transformed
vector is being used as a surrogate for resolution. In "long-edge-feed"
situations, the first component of the transformed vector would be
0, causing the second division to be 0/0 (there is also a problem for
machines with resolution below 72 dpi).

Cambridge Scientific is aware of this problem and has indicated that
they would make a fix available; in the interim, the following code
change should also do the trick:

    /pF
      4.5 0 C defaultmatrix dtransform
      D 0 eq
        { p }
        { e p }
      ifelse
      D 9. d round
      D 0 eq
        { p }
        { d }
      ifelse
    def

Good Luck.

                                            Jan Stoeckenius
                                            QMS/Imagen Corporation

Disclaimer: My firm is in the business of selling PostScript printers,
and all information provided above should be read with that fact
in mind.