home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / ghostscript / 8.64 / Resource / Init / pdf_cslayer.ps < prev    next >
Encoding:
Text File  |  2009-04-17  |  4.0 KB  |  122 lines

  1. % Copyright (C) 2007 Artifex Software, Inc.
  2. % All Rights Reserved.
  3. %
  4. % This software is provided AS-IS with no warranty, either express or
  5. % implied.
  6. %
  7. % This software is distributed under license and may not be copied, modified
  8. % or distributed except as expressly authorized under the terms of that
  9. % license.  Refer to licensing information at http://www.artifex.com/
  10. % or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
  11. % San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
  12. %
  13. % $Id: pdf_cslayer.ps 8954 2008-08-08 04:22:38Z ray $
  14. % Layer data extraction from Illustator CS2/CS3 files
  15.  
  16. .languagelevel dup 2 .max .setlanguagelevel
  17. .currentglobal //true .setglobal
  18. /pdfdict load dup /pdfopdict get dup length dict copy dup begin /pdfopdict exch put
  19.  
  20. /BMC {
  21.   currentdevice //null //false mark
  22.   /MarkType (BMC)
  23.   /BMC_Tag  8 1 roll 256 string cvs
  24.   //systemdict /CSLAYERDEBUG .knownget {
  25.     { (### BMC to deviceparams, tag: ) print dup = flush } if
  26.   } if
  27.   .putdeviceparamsonly dup type /booleantype ne {
  28.      cleartomark pop
  29.   } if
  30.   pop pop     % discard the device and flag
  31.   pop pop     % discard /BMC_Tag and the tag name
  32. } bind def
  33.  
  34. /BDC {    % send selected BDC info to the device as properties
  35.   10 dict begin    % private working dictionary
  36.   /MarkType (BDC) def    % BDC code
  37.   % process the tag and Title for now
  38.   exch 256 string cvs /BDC_Tag exch def    % convert tag to a string
  39.   dup type /nametype eq {
  40.     dup Page /Properties rget not {
  41.       pop 0 dict    % empty dict in case missing Properties Resource
  42.     } if
  43.     exch pop        % discard the resource name
  44.   } if
  45.  
  46.   dup /Type knownoget { /OCG eq } { //false } ifelse {
  47.     % Illustrator CS3 and higher
  48.     dup /Name knownoget not { () } if    % no Name, use an empty string
  49.     /BDC_Title exch def
  50.  
  51.     dup /Usage knownoget not { 0 dict } if
  52.     dup /View knownoget { /ViewState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
  53.     /BDC_Visible exch def
  54.     dup /Print knownoget { /PrintState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
  55.     /BDC_Printed exch def
  56.     pop  % Usage dict
  57.  
  58.     dup /Intent knownoget {
  59.       dup type /nametype eq {
  60.         /Design eq
  61.       } {
  62.         //false exch { oforce /Design eq or } forall
  63.       } ifelse
  64.     } {
  65.       //false
  66.     } ifelse
  67.     /BDC_Editable exch def
  68.  
  69.     /BDC_Preview //true def
  70.     /BDC_Dimmed //false def
  71.     /BDC_Transparency //true def
  72.     /BDC_FlatLayer //true def
  73.   } {
  74.     % Illustrator CS2
  75.     dup /Title knownoget not { () } if    % no Title, use an empty string
  76.     /BDC_Title exch def
  77.     dup /Visible knownoget not { //true } if % no Visible flag, set true
  78.     /BDC_Visible exch def
  79.     dup /Preview knownoget not { //true } if % no preview flag, set true
  80.     /BDC_Preview exch def
  81.     dup /Editable knownoget not { //true } if % no Editable flag, set true
  82.     /BDC_Editable exch def
  83.     dup /Printed knownoget not { //true } if % no printed flag, set true
  84.     /BDC_Printed exch def
  85.     dup /Dimmed knownoget not { //true } if % no dimmed flag, set true
  86.     /BDC_Dimmed exch def
  87.     dup /Transparency knownoget not { //true } if % no Transparency flag, set true
  88.     /BDC_Transparency exch def
  89.     dup /FlatLayer knownoget not { //true } if % no flat layer flag, set true
  90.     /BDC_FlatLayer exch def
  91.   } ifelse
  92.  
  93.   % now send the collected info to the device
  94.   //systemdict /CSLAYERDEBUG .knownget {
  95.     { (### BDC info to deviceparams: ) print currentdict === flush } if
  96.   } if
  97.   currentdevice //null //false mark currentdict { } forall
  98.   .putdeviceparamsonly dup type /booleantype ne {
  99.     cleartomark pop
  100.   } if
  101.   pop pop     % discard the device and flag
  102.   end        % discard private dict
  103.   pop        % done with properties dict
  104. } bind def
  105.  
  106. /EMC {
  107.   currentdevice //null //false mark /MarkType (EMC)
  108.   //systemdict /CSLAYERDEBUG .knownget {
  109.     { (### EMC to deviceparams) = flush } if
  110.   } if
  111.   .putdeviceparamsonly dup type /booleantype ne {
  112.        cleartomark pop
  113.   } if
  114.   pop pop     % discard the device and flag
  115. } bind def
  116.  
  117. currentdict readonly pop end
  118. .setglobal
  119. .setlanguagelevel
  120.