[gs-cvs] rev 8266 - in trunk/gs: doc lib src

alexcher at ghostscript.com alexcher at ghostscript.com
Tue Oct 2 16:55:31 PDT 2007


Author: alexcher
Date: 2007-10-02 16:55:30 -0700 (Tue, 02 Oct 2007)
New Revision: 8266

Added:
   trunk/gs/lib/pdf_cslayer.ps
Modified:
   trunk/gs/doc/Develop.htm
   trunk/gs/src/int.mak
Log:
Add extraction of layer information from Illustratir CS2/CS3 PDF files
to the code base but don't run it in the default configuration.

DIFFERENCES:
None, doesn't run.


Modified: trunk/gs/doc/Develop.htm
===================================================================
--- trunk/gs/doc/Develop.htm	2007-10-02 07:31:58 UTC (rev 8265)
+++ trunk/gs/doc/Develop.htm	2007-10-02 23:55:30 UTC (rev 8266)
@@ -2963,7 +2963,18 @@
 <a href="../lib/pdf_rbld.ps">lib/pdf_rbld.ps</a>,
 <a href="../lib/pdf_ops.ps">lib/pdf_ops.ps</a>,
 <a href="../lib/pdf_sec.ps">lib/pdf_sec.ps</a>.
+</dl>
 
+<p>
+Extraction of layer information from Illustratir CS2/CS3 PDF files is
+implemented for a specific commercial customer; it is not used by any of the
+included drivers. To activate this feature add
+<b><tt>cslayer.dev</tt></b> to the list of feature devices.
+<dl>
+Files:
+<dt>
+<dd>
+<a href="../lib/pdf_cslayer.ps">lib/pdf_cslayer.ps</a>,
 </dl>
 
 <h3><a name="PPD"></a>PostScript Printer Description</h3>

Added: trunk/gs/lib/pdf_cslayer.ps
===================================================================
--- trunk/gs/lib/pdf_cslayer.ps	2007-10-02 07:31:58 UTC (rev 8265)
+++ trunk/gs/lib/pdf_cslayer.ps	2007-10-02 23:55:30 UTC (rev 8266)
@@ -0,0 +1,121 @@
+% Copyright (C) 2007 Artifex Software, Inc.
+% All Rights Reserved.
+%
+% This software is provided AS-IS with no warranty, either express or
+% implied.
+%
+% This software is distributed under license and may not be copied, modified
+% or distributed except as expressly authorized under the terms of that
+% license.  Refer to licensing information at http://www.artifex.com/
+% or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+% San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+%
+% $Id: pdf_layer.ps 8159 2007-08-01 17:19:50Z ray $
+% 
+% Layer data extraction from Illustator CS2/CS3 files
+% 
+
+.languagelevel dup 2 .max .setlanguagelevel
+.currentglobal //true .setglobal
+/pdfdict load dup /pdfopdict get dup length dict copy dup begin /pdfopdict exch put
+
+/BMC {
+  currentdevice //null //false mark
+  /MarkType (BMC)
+  /BMC_Tag  8 1 roll 256 string cvs
+  //systemdict /CSLAYERDEBUG .knownget {
+    { (### BMC to deviceparams, tag: ) print dup = flush } if
+  } if
+  .putdeviceparamsonly dup type /booleantype ne {
+     cleartomark pop
+  } if
+  pop pop 	% discard the device and flag
+  pop pop 	% discard /BMC_Tag and the tag name
+} bind def
+
+/BDC {	% send selected BDC info to the device as properties
+  10 dict begin	% private working dictionary
+  /MarkType (BDC) def	% BDC code
+  % process the tag and Title for now
+  exch 256 string cvs /BDC_Tag exch def	% convert tag to a string
+  dup type /nametype eq {
+    dup Page /Properties rget not {
+      pop 0 dict	% empty dict in case missing Properties Resource
+    } if
+    exch pop		% discard the resource name
+  } if
+
+  dup /Type knownoget { /OCG eq } { //false } ifelse {
+    % Illustrator CS3 and higher
+    dup /Name knownoget not { () } if	% no Name, use an empty string
+    /BDC_Title exch def
+
+    dup /Usage knownoget not { 0 dict } if
+    dup /View knownoget { /ViewState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
+    /BDC_Visible exch def
+    dup /Print knownoget { /PrintState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
+    /BDC_Printed exch def
+    pop  % Usage dict
+ 
+    dup /Intent knownoget {
+      dup type /nametype eq {
+        /Design eq
+      } {
+        //false exch { oforce /Design eq or } forall
+      } ifelse
+    } {
+      //false
+    } ifelse
+    /BDC_Editable exch def
+
+    /BDC_Preview //true def
+    /BDC_Dimmed //false def
+    /BDC_Transparency //true def
+    /BDC_FlatLayer //true def
+  } {
+    % Illustrator CS2
+    dup /Title knownoget not { () } if	% no Title, use an empty string
+    /BDC_Title exch def
+    dup /Visible knownoget not { //true } if % no Visible flag, set true
+    /BDC_Visible exch def
+    dup /Preview knownoget not { //true } if % no preview flag, set true
+    /BDC_Preview exch def
+    dup /Editable knownoget not { //true } if % no Editable flag, set true
+    /BDC_Editable exch def
+    dup /Printed knownoget not { //true } if % no printed flag, set true
+    /BDC_Printed exch def
+    dup /Dimmed knownoget not { //true } if % no dimmed flag, set true
+    /BDC_Dimmed exch def
+    dup /Transparency knownoget not { //true } if % no Transparency flag, set true
+    /BDC_Transparency exch def
+    dup /FlatLayer knownoget not { //true } if % no flat layer flag, set true
+    /BDC_FlatLayer exch def
+  } ifelse
+
+  % now send the collected info to the device
+  //systemdict /CSLAYERDEBUG .knownget {
+    { (### BDC info to deviceparams: ) print currentdict === flush } if
+  } if
+  currentdevice //null //false mark currentdict { } forall
+  .putdeviceparamsonly dup type /booleantype ne {
+    cleartomark pop
+  } if
+  pop pop 	% discard the device and flag
+  end		% discard private dict
+  pop		% done with properties dict
+} bind def
+
+/EMC {
+  currentdevice //null //false mark /MarkType (EMC)
+  //systemdict /CSLAYERDEBUG .knownget {
+    { (### EMC to deviceparams) = flush } if
+  } if
+  .putdeviceparamsonly dup type /booleantype ne {
+       cleartomark pop
+  } if
+  pop pop 	% discard the device and flag
+} bind def
+
+currentdict readonly pop end
+.setglobal
+.setlanguagelevel


Property changes on: trunk/gs/lib/pdf_cslayer.ps
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/gs/src/int.mak
===================================================================
--- trunk/gs/src/int.mak	2007-10-02 07:31:58 UTC (rev 8265)
+++ trunk/gs/src/int.mak	2007-10-02 23:55:30 UTC (rev 8266)
@@ -1893,6 +1893,11 @@
 	$(ADDMOD) $(PSD)pdfread -ps pdf_rbld
 	$(ADDMOD) $(PSD)pdfread -ps pdf_base pdf_draw pdf_font pdf_main pdf_sec
 
+# Optional Illustrator CS2/CS3 layer info extractor
+
+$(PSD)cslayer.dev : $(INT_MAK) $(ECHOGS_XE) $(PSD)pdfread.dev
+	$(SETMOD) $(PSD)cslayer -ps pdf_cslayer
+
 # ---------------- Font API ---------------- #
 
 $(PSD)fapi.dev : $(INT_MAK) $(ECHOGS_XE) $(PSOBJ)zfapi.$(OBJ)\



More information about the gs-cvs mailing list