Disabling Color space substitution for pdfwrite
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Note: I would appreciate suggestions for alternate choices for the
name of the switch. I would also like a means to make this automatic
for the pdfwrite device.
Log Message:
Provide a means for disabling color space substitution.
DETAILS:
Ghostscript supports substituting CIE and ICC color spaces for DeviceGray
DeviceRGB, and DeviceCMYK color spaces. This is part of the support for
the UseCIEColor feature in PostScript. This substitution is done inside
the PostScript code in lib/gs_devcs.ps.
The recent improvements to the pdfwrite device mean that the interpreter's
color space and color values are now passed to the output file. Since
the color space substitution is done prior to passing the color space to
the interpreter, the original color space is lost if UseCIEColor is
set. This change provides a means to prevent the substitution. Thus
the original color space is passed to the interpreter and on to the
output file for pdfwrite.
Dan
Index: lib/gs_devcs.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_devcs.ps,v
retrieving revision 1.1
diff -c -5 -r1.1 gs_devcs.ps
*** lib/gs_devcs.ps 22 Aug 2002 07:12:28 -0000 1.1
--- lib/gs_devcs.ps 11 Sep 2003 05:45:06 -0000
***************
*** 64,74 ****
/cs_get_currentcmyk { pop 1 exch sub 0 0 0 4 -1 roll } bind
/cs_validate {}
/cs_substitute
{
! .getuseciecolor
{ /DefaultGray /ColorSpace findresource }
{ dup }
ifelse
}
bind
--- 64,74 ----
/cs_get_currentcmyk { pop 1 exch sub 0 0 0 4 -1 roll } bind
/cs_validate {}
/cs_substitute
{
! .getuseciecolor NOSUBCOLORSPACES not and
{ /DefaultGray /ColorSpace findresource }
{ dup }
ifelse
}
bind
***************
*** 127,137 ****
/cs_validate {}
/cs_substitute
{
! .getuseciecolor
{ /DefaultRGB /ColorSpace findresource }
{ dup }
ifelse
}
bind
--- 127,137 ----
/cs_validate {}
/cs_substitute
{
! .getuseciecolor NOSUBCOLORSPACES not and
{ /DefaultRGB /ColorSpace findresource }
{ dup }
ifelse
}
bind
Index: lib/gs_init.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_init.ps,v
retrieving revision 1.95
diff -c -5 -r1.95 gs_init.ps
*** lib/gs_init.ps 20 Aug 2003 17:58:41 -0000 1.95
--- lib/gs_init.ps 11 Sep 2003 05:45:09 -0000
***************
*** 144,153 ****
--- 144,154 ----
currentdict /NOPAUSE known /NOPAUSE exch def
currentdict /NOPLATFONTS known /NOPLATFONTS exch def
currentdict /NOPROMPT known /NOPROMPT exch def
currentdict /NOTRANSPARENCY known /NOTRANSPARENCY exch def
currentdict /DOPS known /DOPS exch def
+ currentdict /NOSUBCOLORSPACES known /NOSUBCOLORSPACES exch def
% The default value of ORIENT1 is true, not false.
currentdict /ORIENT1 known not { /ORIENT1 true def } if
currentdict /OSTACKPRINT known /OSTACKPRINT exch def
currentdict /OUTPUTFILE known % obsolete
{ /OutputFile /OUTPUTFILE load def