星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pdf_cslayer.ps 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. %
  15. % Layer data extraction from Illustator CS2/CS3 files
  16. %
  17. .languagelevel dup 2 .max .setlanguagelevel
  18. .currentglobal //true .setglobal
  19. /pdfdict load dup /pdfopdict get dup length dict copy dup begin /pdfopdict exch put
  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. /BDC { % send selected BDC info to the device as properties
  34. 10 dict begin % private working dictionary
  35. /MarkType (BDC) def % BDC code
  36. % process the tag and Title for now
  37. exch 256 string cvs /BDC_Tag exch def % convert tag to a string
  38. dup type /nametype eq {
  39. dup Page /Properties rget not {
  40. pop 0 dict % empty dict in case missing Properties Resource
  41. } if
  42. exch pop % discard the resource name
  43. } if
  44. dup /Type knownoget { /OCG eq } { //false } ifelse {
  45. % Illustrator CS3 and higher
  46. dup /Name knownoget not { () } if % no Name, use an empty string
  47. /BDC_Title exch def
  48. dup /Usage knownoget not { 0 dict } if
  49. dup /View knownoget { /ViewState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
  50. /BDC_Visible exch def
  51. dup /Print knownoget { /PrintState knownoget { /OFF ne } { //true } ifelse } { //true } ifelse
  52. /BDC_Printed exch def
  53. pop % Usage dict
  54. dup /Intent knownoget {
  55. dup type /nametype eq {
  56. /Design eq
  57. } {
  58. //false exch { oforce /Design eq or } forall
  59. } ifelse
  60. } {
  61. //false
  62. } ifelse
  63. /BDC_Editable exch def
  64. /BDC_Preview //true def
  65. /BDC_Dimmed //false def
  66. /BDC_Transparency //true def
  67. /BDC_FlatLayer //true def
  68. } {
  69. % Illustrator CS2
  70. dup /Title knownoget not { () } if % no Title, use an empty string
  71. /BDC_Title exch def
  72. dup /Visible knownoget not { //true } if % no Visible flag, set true
  73. /BDC_Visible exch def
  74. dup /Preview knownoget not { //true } if % no preview flag, set true
  75. /BDC_Preview exch def
  76. dup /Editable knownoget not { //true } if % no Editable flag, set true
  77. /BDC_Editable exch def
  78. dup /Printed knownoget not { //true } if % no printed flag, set true
  79. /BDC_Printed exch def
  80. dup /Dimmed knownoget not { //true } if % no dimmed flag, set true
  81. /BDC_Dimmed exch def
  82. dup /Transparency knownoget not { //true } if % no Transparency flag, set true
  83. /BDC_Transparency exch def
  84. dup /FlatLayer knownoget not { //true } if % no flat layer flag, set true
  85. /BDC_FlatLayer exch def
  86. } ifelse
  87. % now send the collected info to the device
  88. //systemdict /CSLAYERDEBUG .knownget {
  89. { (### BDC info to deviceparams: ) print currentdict === flush } if
  90. } if
  91. currentdevice //null //false mark currentdict { } forall
  92. .putdeviceparamsonly dup type /booleantype ne {
  93. cleartomark pop
  94. } if
  95. pop pop % discard the device and flag
  96. end % discard private dict
  97. pop % done with properties dict
  98. } bind def
  99. /EMC {
  100. currentdevice //null //false mark /MarkType (EMC)
  101. //systemdict /CSLAYERDEBUG .knownget {
  102. { (### EMC to deviceparams) = flush } if
  103. } if
  104. .putdeviceparamsonly dup type /booleantype ne {
  105. cleartomark pop
  106. } if
  107. pop pop % discard the device and flag
  108. } bind def
  109. currentdict readonly pop end
  110. .setglobal
  111. .setlanguagelevel