[comp.sys.next] DPS dictfull error with Win3 PS files

paul@cgh.com (Paul Homchick) (04/02/91)

  I have a copy of Excel 3.0, which runs under Windows 3.0 on a DOS
machine.  I have the Windows printer configured as a NEC LC-890 (v47)
postscript printer (which is normally connected to the DOS machine),
and the device set as a FILE.  When I create a postscript file from
this system, I remove the ^Ds from the beginning of the file, remove
the CRs and and change the %!PS-Adobe-3.0 line to %!.  When I send the
resulting file to my NeXT (040 cube, Nextstep 2.0) printer with lpr, I
get a pop-up PostScript error window that reports:
     %%[Error: dictfull; Offending Command: def]%%    OK <- (not ok!)
and, the resulting output is nil.

  Presumably, the dictionary is being filled up by all of the stuff in
the Windows postscript header.  Is there a way around this, either by
somehow tuning parameters in DPS, or by performing some surgery on the
Windows postscript file?  I really had my heart set on 400dpi for a
proposal I was working on. ;-(

  Thanks to any and all!
-- 
Paul Homchick                    :UUCP     {rutgers | uunet} !cbmvax!cgh!paul
Chimitt Gilman Homchick, Inc.    :Internet                       paul@cgh.com
259 Radnor-Chester Rd, Suite 140 :MCI                               PHOMCHICK
Radnor, PA  19087-5299           :GEnie                              HOMCHICK

paul@cgh.com (Paul Homchick) (04/07/91)

In article <1537@cgh.com> paul@cgh.com (Paul Homchick) wrote:
>  I have a copy of Excel 3.0, which runs under Windows 3.0 ...
>I have the Windows printer configured as a NEC LC-890 (v47)...
>When I create a postscript file [... and send it to my NeXT printer,]
>I get a pop-up PostScript error window that reports:
>     %%[Error: dictfull; Offending Command: def]%%
>and, the resulting output is nil.

And, after a bit, he got some help from NeXT.

In using the postscript driver for the NEC, windows was including the
following PS sequence:

	{statusdict begin 2 setpapertray end }stopped pop

If there is no setpapertray (and with a NeXT printer, there is not),
statusdict is left on the dictionary stack.  statusdict is big enough
that the program soon runs out of dictionary room and bombs.  Removing
the above sequence solved the problem.

My correspondent mentioned that "There are better ways to safely
execute a PS operator if it [might] not be present".  Now, I'm
curious, does anyone know the correct way of doing this?

If I had a hat, it would be off to the fine folks at NeXT who are
always trying to help.  This problem was entirely mine and Microsoft's
but someone at NeXT took the time to help me with this.

-- 
Paul Homchick                    :UUCP     {rutgers | uunet} !cbmvax!cgh!paul
Chimitt Gilman Homchick, Inc.    :Internet                       paul@cgh.com
259 Radnor-Chester Rd, Suite 140 :MCI                               PHOMCHICK
Radnor, PA  19087-5299           :GEnie                              HOMCHICK

pgraff@next.com (Peter Graffagnino) (04/08/91)

In article <1542@cgh.UUCP> paul@cgh.com (Paul Homchick) writes:
>In using the postscript driver for the NEC, windows was including the
>following PS sequence:
>
>	{statusdict begin 2 setpapertray end }stopped pop
>
>If there is no setpapertray (and with a NeXT printer, there is not),
>statusdict is left on the dictionary stack.  statusdict is big enough
>that the program soon runs out of dictionary room and bombs.  Removing
>the above sequence solved the problem.
>
>My correspondent mentioned that "There are better ways to safely
>execute a PS operator if it [might] not be present".  Now, I'm
>curious, does anyone know the correct way of doing this?
>


        The best way to conditionally execute operators that may not
exist is to use the `known' operator.  In the example above, the most
robust implementation is:

statusdict /setpapertray known {
        2 statusdict /setpapertray get exec
} if

	Hopefully Microsoft will include this in a future release of
their Windows driver.

Peter Graffagnino
Graphics Software
NeXT Computer, Inc.

glenn@heaven.woodside.ca.us (Glenn Reid) (04/08/91)

Paul Homchick writes

> In using the postscript driver for the NEC, windows was including the
> following PS sequence:
> 
> 	{statusdict begin 2 setpapertray end }stopped pop
> 
> My correspondent mentioned that "There are better ways to safely
> execute a PS operator if it [might] not be present".  Now, I'm
> curious, does anyone know the correct way of doing this?

There are two operators that are designed for this kind of thing.
They are "where" and "known".  Since "statusdict" may be missing in
addition to "setpapertray", you should check for both of them.

Here is a reasonable way to execute this kind of code:

/statusdict where { %if
    pop
    statusdict begin
        /setpapertray where { pop 2 setpapertray } if
    end
} if

--
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

edwardj@microsoft.UUCP (Edward JUNG) (04/09/91)

In article <471@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes:
>Paul Homchick writes
>
>> In using the postscript driver for the NEC, windows was including the
>> following PS sequence:
>> 
>> 	{statusdict begin 2 setpapertray end }stopped pop
>> 
>> My correspondent mentioned that "There are better ways to safely
>> execute a PS operator if it [might] not be present".  Now, I'm
>> curious, does anyone know the correct way of doing this?
>
>There are two operators that are designed for this kind of thing.
>They are "where" and "known".  Since "statusdict" may be missing in
>addition to "setpapertray", you should check for both of them.
>
The NEC printer *does* have a paper tray operator; you might
want to use the generic postscript driver in Windows in
preference to the NEC one -- this may clear up your problem
with use of operators not supported by the NeXT printer.

Please note that the reason all those print drivers are shipped
with Windows is so that the driver output can be tweaked to
match the selected printer hardware. A number of companies,
including Microsoft, are investigating how to do this without
involving the user, but if this is to be done in a generic
store and forward manner (e.g. the eventual target device is
not known and cannot be communicated with at the time the
output file is generated), the problem is very intractable
for high-end output.

--
Edward Jung
Microsoft Corp.

My opinions do not reflect any policy of my employer.