Bug 607425

Summary: setdistillerparams resets page device
Product: Ghostscript Reporter: Jack Moffitt <jack>
Component: PDF WriterAssignee: Ray Johnston <ray.johnston>
Status: NOTIFIED FIXED    
Severity: normal Keywords: bountiable
Priority: P2    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---

Description Jack Moffitt 2002-09-10 10:35:32 UTC
Originally reported by: nobody@users.sourceforge.net
The execution of setdistillerparams seems to reset the
current 
page device at least partly. E.g. the values for keys
like
/BeginPage and /EndPage are reset to their default
values.

This behaviour seems to be due to the implementation of
setdistillerparams by .putdeviceparams which does not
allow
to pass all page device parameters.

Example code to demonstrate the error:

%!
<</BeginPage{==}>>setpagedevice
currentpagedevice/BeginPage get ==
<<>>setdistillerparams
currentpagedevice/BeginPage get ==


The first inquiry reports {==} as expected, but the
second one reports {.callbeginpage}, and the "{==}"
is no longer executed on a showpage event.
Comment 1 Jack Moffitt 2002-09-10 10:39:47 UTC
Comment originally by nobody@users.sourceforge.net
Logged In: NO 

forgot to mention the gs version currently used (7.00), but
a look at the
cvs tree (looking into both gs_pdfwr.ps and zdevice.c
indicates that
the error will still be present.
Comment 2 Ray Johnston 2003-04-02 21:42:42 UTC
This bug is related to, and might be solved by the
same method as #563287.
Comment 3 Ray Johnston 2004-01-13 22:51:24 UTC
The patch:

http://www.ghostscript.com/pipermail/gs-cvs/2004-January/004000.html

changes the setdistillerparams function to make sure that the pagedevice
is not reset or erased.