RE: Disabling Color space substitution for pdfwrite

"Dan Coby" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Igor,

>First, you patch DeviceGray and DeviceRGB, and don't patch DeviceCMYK.
>Why so ?

This was a mistake that I introduced while cleaning up the diff file.
I removed some debug related changes and accidentally removed the DeviceCMYK
change from the diff file.  DeviceCMYK does need the same changes.
The revised diff file is below.


>Second, I'm unclear why a new switch is necessary.
>Simply don't set UseCIEColor if you don't need the substitution.

UseCIEColor can be and is changed by many files.  It is also set by the
PDF parser.  I wanted something which is independent.  The NOCIE switch
completely removes all CIE and ICC color spaces.


>Third, I'd appreciate an appropriate documentation change is included.

Here are the relevant changes to doc/Use.htm.  Note:  I also ran a
spell check and HTML format check on the file so the actual changes are
more extensive.  The full list of changes is in the enclosed file doc.dif.

+ <dt><b><tt>-dNOSUBCOLORSPACES</tt></b>
+ <dd>This switch prevents the substitution of the
<b><tt>ColorSpace</tt></b>
+ resources (<b><tt>DefaultGray</tt></b>, <b><tt>DefaultRGB</tt></b>, and
+ <b><tt>DefaultCMYK</tt></b>) for the <b><tt>DeviceGray</tt></b>,
+ <b><tt>DeviceRGB</tt></b>, and <b><tt>DeviceCMYK</tt></b> color spaces.
+ This switch is primarily useful for PDF creation using the
<tt><b>pdfwrite</b></tt>
+ device when retaining the color spaces from the original dicument is
+ important.
+ </dl>
+
+ <dl>


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 19:34:25 -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
***************
*** 186,196 ****

      /cs_validate {}

      /cs_substitute
        {
!         .getuseciecolor
            { /DefaultCMYK /ColorSpace findresource }
            { dup }
          ifelse
        }
      bind
--- 186,196 ----

      /cs_validate {}

      /cs_substitute
        {
!         .getuseciecolor NOSUBCOLORSPACES not and
            { /DefaultCMYK /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 19:34:27 -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

-----Original Message-----
From: Igor V. Melichev [mailto:[email protected]]
Sent: Thursday, September 11, 2003 3:22 AM
To: [email protected]; Gs-Code-Review
Subject: Re: Disabling Color space substitution for pdfwrite


Dan,

> From: "Dan Coby" <[email protected]>
> To: "Gs-Code-Review" <[email protected]>
> Cc: "Igor V. Melichev" <[email protected]>
> Sent: Thursday, September 11, 2003 10:16 AM
> Subject: Disabling Color space substitution for pdfwrite

I'm unclear about this change.

First, you patch DeviceGray and DeviceRGB, and don't patch DeviceCMYK.
Why so ?

Second, I'm unclear why a new switch is necessary.
Simply don't set UseCIEColor if you don't need the substitution.

Third, I'd appreciate an appropriate documentation change is included.

Thank you.

Igor.
doc.dif (video/x-dv, 15.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.