home *** CD-ROM | disk | FTP | other *** search
/ OneVision 3.03 / OneVision3.03.iso / Apps / PDFView.app / pdfpkg.procset < prev    next >
Text File  |  1996-11-04  |  28KB  |  780 lines

  1. %!
  2. %%Copyright: Copyright 1995 Guenther Fuerthaller. All Rights Reserved.
  3. /currentpacking where {pop currentpacking true setpacking}if
  4. %/L2 false def /where {dup /colorimage eq {pop false} {where} ifelse} bind def
  5. /L2 /languagelevel where {pop languagelevel 2 ge} {false} ifelse def
  6. /packedarray where {pop} {/packedarray {array astore readonly} bind def} ifelse
  7. /isarray {type dup /arraytype eq exch /packedarraytype eq or} bind def
  8. /hardbind
  9. {    dup xcheck exch [ exch
  10.     {    dup xcheck
  11.         {    dup type /nametype eq
  12.             {dup where {exch get dup xcheck {dup isarray {/exec load} if} if} if}
  13.             {dup isarray {hardbind} if}
  14.             ifelse
  15.         } if
  16.     } forall
  17.     counttomark packedarray exch pop exch {cvx} if
  18. } bind def
  19. systemdict /nextimage known
  20. {
  21. %% bug in the next windowserver: CCITTFax filters don't work and SubFileDecode has a limit of 65535
  22.     /repairfilterbugsdict 2 dict def
  23.     repairfilterbugsdict begin
  24.     revision 125 lt {/CCITTFaxDecode {pop pop pop 500 string 1 packedarray cvx 0 () /SubFileDecode} hardbind def} if
  25.     revision 173 lt
  26.     {    /SubFileDecode
  27.         {    2 index 65535 gt 2 index length 0 eq and
  28.             {    4 2 roll
  29.                 20 string
  30.                 20 string 3 -1 roll 1 index cvs pop
  31.                 3 -1 roll dup type /filetype eq {cvlit} {0 () /SubFileDecode filter} ifelse
  32.                 65535 string
  33.                 {    2 index cvi dup 2 index length lt {0 exch getinterval 0} {1 index length sub} ifelse
  34.                     5 -2 roll copy cvs pop dup length 0 gt {readstring} {exch} ifelse pop
  35.                 }
  36.                 aload length 4 add packedarray cvx 0 4 -2 roll
  37.             } if
  38.         } hardbind def
  39.     } if
  40.     end
  41.     repairfilterbugsdict length 0 gt
  42.     {    /filter
  43.         {    repairfilterbugsdict 1 index known
  44.             {repairfilterbugsdict 1 index get exec} if
  45.             filter
  46.         } hardbind def
  47.     } if
  48.     version cvr 2015 ge /ovsyncexec where {pop false} {true} ifelse and
  49.     {    %/setcolorspace
  50.         %{    dup dup isarray {0 get} if
  51.         %    /CIEBasedA eq {[/Separation /Dummy 4 -1 roll {}]} if
  52.         %    setcolorspace
  53.         %} hardbind def 
  54.         /setcolor
  55.         {    currentcolorspace 0 get /CIEBasedA eq
  56.             {    [/Indexed currentcolorspace 4095 {4095 div}] setcolorspace
  57.                 4095 mul
  58.             } if
  59.             setcolor
  60.         } hardbind def
  61.         /image
  62.         {    dup type /dicttype eq
  63.             {    currentcolorspace 0 get /CIEBasedA eq
  64.                 {    currentcolor setcolor
  65.                     0 dict copy begin
  66.                     /Decode [/Decode load {currentcolorspace 2 get mul} forall] def
  67.                     currentdict end
  68.                 } if
  69.             } if
  70.             image
  71.         } hardbind def
  72.     } if
  73. } if
  74. /NextStepEncoding where
  75. {    pop
  76.     /nxfindfont /findfont load def
  77.     /CopyOfStandardEncoding StandardEncoding dup length array copy def
  78.     /findfont
  79.     {    /currentshared where {pop currentshared} {false} ifelse
  80.          {nxfindfont}
  81.         {    dup nxfindfont
  82.             dup /Encoding get NextStepEncoding eq
  83.             {    dup length dict begin
  84.                 {1 index /FID ne {def} {pop pop} ifelse} forall
  85.                 /Encoding CopyOfStandardEncoding def
  86.                 currentdict end definefont
  87.             }
  88.             {exch pop}
  89.             ifelse
  90.         }
  91.         ifelse
  92.     } bind def
  93. } if
  94. /product where {pop product} {(unknown)} ifelse
  95. (Ghostscript) search exch pop
  96. {    pop pop
  97. %% In some cases ASCIIHexDecode filter doesn't read the eof marker
  98.     /repairfilterbugsdict 1 dict def
  99.     repairfilterbugsdict begin
  100.     /ASCIIHexDecode
  101.     {    filter
  102.         3 dict begin
  103.         /src exch def
  104.         /state 1 string dup 0 0 put def
  105.         /buf 501 string def
  106.         [    currentdict end
  107.             {    begin
  108.                 {    {    /state load 0 1 put
  109.                         /src load /buf load readstring
  110.                         {0 500 getinterval}
  111.                         {/state load 0 2 put /src load closefile}
  112.                         ifelse
  113.                     }
  114.                     {    /src load /buf load dup 0 1 index 500 get put 1 500 getinterval readstring
  115.                         {pop 500}
  116.                         {length 1 add /state load 0 2 put /src load closefile}
  117.                         ifelse
  118.                         /buf load 0 3 -1 roll getinterval
  119.                     }
  120.                     {()}
  121.                 }
  122.                 /state load 0 get get exec
  123.                 end
  124.             } /exec cvx
  125.         ] cvx 0 () /SubFileDecode
  126.     } hardbind def
  127.     end
  128.     /filter
  129.     {    repairfilterbugsdict 1 index known
  130.         {repairfilterbugsdict 1 index get exec} if
  131.         filter
  132.     } hardbind def
  133. } if
  134. L2 not
  135. {    /setcmykcolor where
  136.     {pop}
  137.     {    /setcmykcolor
  138.         {1 sub 4 1 roll 3 {3 index add neg dup 0 lt { pop 0 } if 3 1 roll} repeat setrgbcolor pop} hardbind def
  139.     }
  140.     ifelse
  141.     /rectclip where
  142.     {pop}
  143.     {    /rectclip
  144.         {4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath clip newpath} hardbind def
  145.     }
  146.     ifelse
  147.     /execform
  148.     {    gsave dup begin
  149.         Matrix concat BBox aload pop exch 3 index sub exch 2 index sub rectclip
  150.         /PaintProc load end exec
  151.         grestore
  152.     } hardbind def
  153.     /UserObjects 10 array def
  154.     /defineuserobject
  155.     {    exch dup 1 add dup /UserObjects load length gt
  156.         {array dup 0 /UserObjects load putinterval /UserObjects exch store} {pop} ifelse
  157.         /UserObjects load exch 3 -1 roll put
  158.     } hardbind def
  159.     /undefineuserobject {/UserObjects load exch null put} hardbind def
  160.     /execuserobject {/UserObjects load exch get exec} hardbind def
  161. } if
  162.  
  163. mark /AHx /ASCIIHexDecode /A85 /ASCII85Decode /CCF /CCITTFaxDecode
  164. /DCT /DCTDecode /LZW /LZWDecode /RL /RunLengthDecode
  165. counttomark 2 idiv dup dict begin {def} repeat currentdict end /ShrtFN exch def pop
  166. mark /CMYK /DeviceCMYK /G /DeviceGray /RGB /DeviceRGB /I /Indexed /CG /CalGray /CR /CalRGB /CC /CalCMYK
  167. counttomark 2 idiv dup dict begin {def} repeat currentdict end /ShrtCSN exch def pop
  168. mark /W /Width /H /Height /BPC /BitsPerComponent /CS /ColorSpace /F /Filter
  169. /I /Interpolate /IM /ImageMask /D /Decode /DP /DecodeParms
  170. counttomark 2 idiv dup dict begin {def} repeat currentdict end /imgparaabrevdict exch def pop
  171. /buildimagedict
  172. {    counttomark 2 idiv dup 10 add dict begin
  173.     {    imgparaabrevdict 2 index known {imgparaabrevdict 3 -1 roll get exch} if
  174.         1 index /ColorSpace eq
  175.         {    dup type /nametype eq
  176.             {ShrtCSN 1 index known {ShrtCSN exch get} if}
  177.             {dup 0 /Indexed put dup 1 2 copy get ShrtCSN 1 index known {ShrtCSN exch get} if put}
  178.             ifelse
  179.         } if
  180.         1 index /Filter eq
  181.         {    dup isarray
  182.             {[exch {ShrtFN 1 index known {ShrtFN exch get} if} forall]}
  183.             {ShrtFN 1 index known {ShrtFN exch get} if}
  184.             ifelse
  185.         } if
  186.         def
  187.     } repeat cleartomark currentdict end
  188. } hardbind def
  189.  
  190. /numcolorspacecomponents 8 dict def
  191. numcolorspacecomponents begin
  192. /DeviceGray 1 def
  193. /DeviceRGB 3 def
  194. /DeviceCMYK 4 def
  195. /CIEBasedABC 3 def
  196. /CIEBasedA 1 def
  197. /Pattern 1 def
  198. /Indexed 1 def
  199. /Separation 1 def
  200. end
  201.  
  202. /pdfpkg 200 dict def
  203. pdfpkg begin
  204.  
  205. /pdfpkgget {pdfpkg exch get} hardbind def
  206. /pdfpkgput {pdfpkg 3 1 roll put} hardbind def
  207. /pdfpkgexec {pdfpkgget exec} hardbind def
  208.  
  209. /cmtmpmat matrix def
  210. /clipper {} def
  211. /fillcolorspace null def
  212. /strokecolorspace null def
  213. /fillcolor null def
  214. /fillcolorarrays [null [0] null [0 0 0] [0 0 0 0]] def
  215. /strokecolor null def
  216. /strokecolorarrays [null [0] null [0 0 0] [0 0 0 0]] def
  217. /mustinstallfillcolor true def
  218. /mustinstallstrokecolor true def
  219. /InText false def
  220. /TextLeading 0 def
  221. /TextRise 0 def
  222. /TextCharSpacing 0 def
  223. /TextWordSpacing 0 def
  224. /TextRendering 0 def
  225. /TextHScale 1 def
  226. /TextSize 1 def
  227. /TextMatrix matrix def
  228. /TextBaseMatrix matrix def
  229.  
  230. /_q null def
  231. /q {/_q save pdfpkgput} hardbind def
  232. /Q {/_q pdfpkgget restore} hardbind def
  233.  
  234. /cs
  235. {    load /fillcolorspace 1 index pdfpkgput
  236.     /fillcolor fillcolorarrays numcolorspacecomponents 4 -1 roll 0 get get get pdfpkgput
  237.     /mustinstallfillcolor true pdfpkgput
  238. } hardbind def
  239. /CS
  240. {    load /strokecolorspace 1 index pdfpkgput
  241.     /strokecolor strokecolorarrays numcolorspacecomponents 4 -1 roll 0 get get get pdfpkgput
  242.     /mustinstallstrokecolor true pdfpkgput
  243. } hardbind def
  244. /sc
  245. {    /fillcolor pdfpkgget astore pop
  246.     /mustinstallfillcolor true pdfpkgput
  247. } hardbind def
  248. /SC
  249. {    /strokecolor pdfpkgget astore pop
  250.     /mustinstallstrokecolor true pdfpkgput
  251. } hardbind def
  252. /g {/DefaultGray cs sc} hardbind def
  253. /G {/DefaultGray CS SC} hardbind def
  254. /rg {/DefaultRGB cs sc} hardbind def
  255. /RG {/DefaultRGB CS SC} hardbind def
  256. /k {/DeviceCMYK cs sc} hardbind def
  257. /K {/DeviceCMYK CS SC} hardbind def
  258. /pc {/DefaultGray cs pop 0.5 sc} hardbind def
  259. /PC {/DefaultGray CS pop 0.5 SC} hardbind def
  260. L2
  261. {    /pkgsetcolorspace /setcolorspace load def
  262.     /pkgsetcolor /setcolor load def
  263.     /pkgimage /image load def
  264.     /pkgimagemask /imagemask load def
  265. }
  266. {    /pkgsetcolorspacedict 4 dict def
  267.     /pkgsetcolorspace {dup isarray {0 get} if pkgsetcolorspacedict exch get {aload pop pdfpkgput} forall} hardbind def
  268.     /pkgsetcolor null def
  269.     /pkgimage null def
  270.     /pkgimagemask
  271.     {    begin {/Width /Height /ImageMatrix /DataSource} {load} forall /Decode load 0 get 0 ne 3 1 roll end
  272.         imagemask
  273.     } hardbind def
  274.     /pushimageparams {begin {/Width /Height /BitsPerComponent /ImageMatrix /DataSource} {load} forall end} hardbind def
  275.     /pkggrayimage {pushimageparams image} hardbind def
  276.     /pkgimageworkbuf 65535 string def
  277.     /havecolorimage /colorimage where {pop true} {false} ifelse def
  278.     havecolorimage not {save} if
  279.     /pkgrgbimage {pushimageparams false 3 colorimage} hardbind def
  280.     /pkgcmykimage {pushimageparams false 4 colorimage} hardbind def
  281.     havecolorimage not {restore} if
  282.     havecolorimage {save} if
  283.     /NTSCSUM {.11 mul exch .59 mul add exch .3 mul add} hardbind def
  284.     /rgbtogray8Bit {NTSCSUM round cvi} hardbind def
  285.     /cmyktogray8Bit {4 1 roll NTSCSUM add dup 255 gt {pop 0} {255 exch sub} ifelse round cvi} hardbind def
  286.     /pkgrgbimage
  287.     {    pushimageparams
  288.         {    {exec pkgimageworkbuf 0 3 -1 roll length 8 mul 3 idiv getinterval}
  289.             {exec pkgimageworkbuf 0 3 -1 roll length 4 mul 3 idiv getinterval}
  290.             {exec pkgimageworkbuf 0 3 -1 roll length 2 mul 3 idiv getinterval}
  291.             null
  292.             {    exec 0 1 2 index length 3 idiv 1 sub
  293.                 {2 copy 3 mul 3 getinterval {} forall rgbtogray8Bit pkgimageworkbuf 3 1 roll put} for
  294.                 pkgimageworkbuf 0 3 -1 roll length 3 idiv getinterval
  295.             }
  296.         }
  297.         3 index 2 idiv get aload length 1 add packedarray cvx image
  298.     } hardbind def
  299.     /pkgcmykimage
  300.     {    pushimageparams
  301.         {    {exec pkgimageworkbuf 0 3 -1 roll length 2 mul getinterval}
  302.             {exec pkgimageworkbuf 0 3 -1 roll length getinterval}
  303.             {    exec 0 1 2 index length 2 idiv 1 sub
  304.                 {    2 copy 2 mul 2 getinterval {} forall
  305.                     exch dup -4 bitshift 15 and exch 15 and 3 -1 roll dup -4 bitshift 15 and exch 15 and
  306.                     4 {17 mul 4 1 roll} repeat
  307.                     cmyktogray8Bit pkgimageworkbuf 3 1 roll put
  308.                 } for
  309.                 pkgimageworkbuf 0 3 -1 roll length 2 idiv getinterval
  310.             }
  311.             null
  312.             {    exec 0 1 2 index length 4 idiv 1 sub
  313.                 {2 copy 4 mul 4 getinterval {} forall cmyktogray8Bit pkgimageworkbuf 3 1 roll put} for
  314.                 pkgimageworkbuf 0 3 -1 roll length 4 idiv getinterval
  315.             }
  316.         }
  317.         3 index 2 idiv get aload length 1 add packedarray cvx image
  318.     } hardbind def
  319.     havecolorimage {restore} if
  320.     /pkgimagebuf null def
  321.     /pkgimagestripcnt 0 def
  322.     /pkgindexedimageprocdict 3 dict def
  323.     pkgindexedimageprocdict begin
  324.     /DeviceGray
  325.     {    exec pkgimageworkbuf 0 2 index length getinterval 0 3 -1 roll
  326.         {    3 index exch get
  327.             3 copy put pop 1 add
  328.         } forall pop exch pop
  329.     } hardbind def
  330.     /DeviceRGB
  331.     {    exec pkgimageworkbuf 0 2 index length 3 mul getinterval 0 3 -1 roll
  332.         {    3 index exch 3 mul 3 getinterval
  333.             3 copy putinterval pop 3 add
  334.         } forall pop exch pop
  335.     } hardbind def
  336.     /DeviceCMYK
  337.     {    exec pkgimageworkbuf 0 2 index length 4 mul getinterval 0 3 -1 roll
  338.         {    3 index exch 4 mul 4 getinterval
  339.             3 copy putinterval pop 4 add
  340.         } forall pop exch pop
  341.     } hardbind def
  342.     end
  343.     /normalizelookup
  344.     {    8 dict begin
  345.         /numdestcomps numcolorspacecomponents ColorSpace 1 get dup isarray {0 get} if get def
  346.         /numindices 2 BitsPerComponent exp cvi def
  347.         /maxval numindices 1 sub def
  348.         /decodescale Decode aload pop exch sub maxval div def
  349.         /decodemin Decode 0 get def
  350.         /hival ColorSpace 2 get def
  351.         /srclookup ColorSpace 3 get def
  352.         decodemin 0 ne decodescale 1 ne or hival maxval ne or
  353.         {    /dstlookup numdestcomps numindices mul string def
  354.             0 1 maxval
  355.             {    dup numdestcomps mul exch decodescale mul decodemin add
  356.                 0 2 copy lt {exch} {pop hival 2 copy gt {exch} if} ifelse pop cvi
  357.                 numdestcomps mul numdestcomps srclookup 3 1 roll getinterval
  358.                 dstlookup 3 1 roll putinterval
  359.             } for
  360.             ColorSpace 2 maxval put ColorSpace 3 dstlookup put
  361.             0 maxval Decode astore pop
  362.         } if
  363.         end
  364.     } bind def
  365.     /pkgindexedimage
  366.     {    begin
  367.         normalizelookup
  368.         havecolorimage not /ColorSpace load 1 get dup isarray {0 get} if /DeviceGray ne and
  369.         {    /ColorSpace load 1 get dup isarray {0 get} if /DeviceRGB eq
  370.             {    0 1 /ColorSpace load 2 get
  371.                 {    dup 3 mul 3 /ColorSpace load 3 get 3 1 roll getinterval {} forall rgbtogray8Bit
  372.                     /ColorSpace load 3 get 3 1 roll put
  373.                 } for
  374.             }
  375.             {    0 1 /ColorSpace load 2 get
  376.                 {    dup 4 mul 4 /ColorSpace load 3 get 3 1 roll getinterval {} forall cmyktogray8Bit
  377.                     /ColorSpace load 3 get 3 1 roll put
  378.                 } for
  379.             }
  380.             ifelse
  381.             /ColorSpace load 3 2 copy get 0 3 index 2 get 1 add getinterval put
  382.             /ColorSpace load 1 /DeviceGray put
  383.         } if
  384.         /ColorSpace load 3 get /DataSource load
  385.         pkgindexedimageprocdict /ColorSpace load 1 get dup isarray {0 get} if get
  386.         aload length 2 add packedarray cvx /DataSource exch def
  387.         /ColorSpace dup load 1 get def
  388.         /ColorSpace load pkgsetcolorspace currentdict end /pkgimage pdfpkgexec
  389.     } hardbind def
  390.     pkgsetcolorspacedict begin
  391.     /DeviceGray [[/pkgsetcolor /setgray load] [/pkgimage /pkggrayimage load]] def
  392.     /DeviceRGB [[/pkgsetcolor /setrgbcolor load] [/pkgimage /pkgrgbimage load]] def
  393.     /DeviceCMYK [[/pkgsetcolor /setcmykcolor load] [/pkgimage /pkgcmykimage load]] def
  394.     /Indexed [[/pkgsetcolor null] [/pkgimage /pkgindexedimage load]] def
  395.     end
  396. }
  397. ifelse
  398. /installfillcolor
  399. {    /mustinstallfillcolor pdfpkgget
  400.     {    /fillcolorspace pdfpkgget /pkgsetcolorspace pdfpkgexec
  401.         /fillcolor pdfpkgget aload pop /pkgsetcolor pdfpkgexec
  402.         /mustinstallfillcolor false pdfpkgput
  403.         /mustinstallstrokecolor true pdfpkgput
  404.     } if
  405. } hardbind def
  406. /installstrokecolor
  407. {    /mustinstallstrokecolor pdfpkgget
  408.     {    /strokecolorspace pdfpkgget /pkgsetcolorspace pdfpkgexec
  409.         /strokecolor pdfpkgget aload pop /pkgsetcolor pdfpkgexec
  410.         /mustinstallstrokecolor false pdfpkgput
  411.         /mustinstallfillcolor true pdfpkgput
  412.     } if
  413. } hardbind def
  414.  
  415. /cm {cmtmpmat astore concat} hardbind def
  416. /n {/clipper pdfpkgexec /clipper {} pdfpkgput newpath} hardbind def
  417. /N /n load def
  418. /W {/clipper {clip} pdfpkgput} hardbind def
  419. /W* {/clipper {eoclip} pdfpkgput} hardbind def
  420. /f {/installfillcolor pdfpkgexec q fill Q n} hardbind def
  421. /f* {/installfillcolor pdfpkgexec q eofill Q n} hardbind def
  422. /F /f load def
  423. /F* /f* load def
  424. /S {/installstrokecolor pdfpkgexec q stroke Q n} hardbind def
  425. /s {h S} hardbind def
  426. /B {q f Q S} hardbind def
  427. /B* {q f* Q S} hardbind def
  428. /b {h B} hardbind def
  429. /b* {h B*} hardbind def
  430. /re {4 2 roll m 1 index 0 rlineto 0 exch rlineto neg 0 rlineto h} hardbind def
  431. /ri
  432. {    /findcolorrendering where
  433.     {    pop findcolorrendering pop dup /ColorRendering resourcestatus
  434.         {pop pop /ColorRendering findresource setcolorrendering} {pop} ifelse
  435.     }
  436.     {pop}
  437.     ifelse
  438. } hardbind def
  439. /PS {/pdfdebug where {/pdfdebug get} {false} ifelse {(/PS: ) print dup == flush} if pop} hardbind def
  440.  
  441. /m /moveto load def
  442. /l /lineto load def
  443. /c /curveto load def
  444. /v {currentpoint 6 2 roll c } hardbind def
  445. /y {2 copy c} hardbind def
  446. /h /closepath load def
  447. /d /setdash load def
  448. /j /setlinejoin load def
  449. /J /setlinecap load def
  450. /M /setmiterlimit load def
  451. /w /setlinewidth load def
  452. /defaultflat currentflat def
  453. /i {dup 0 eq {pop defaultflat} if setflat} hardbind def
  454. /d0 /setcharwidth load def
  455. /d1 {setcachedevice /installfillcolor {} pdfpkgput /installstrokecolor {} pdfpkgput} hardbind def
  456.  
  457. /BI {q mark} hardbind def
  458. /EI /Q load def
  459. /DI
  460. {    begin
  461.     /ImageType 1 def
  462.     /ImageMatrix [Width 0 0 Height neg 0 Height] def
  463.     currentdict /ImageMask known not    {/ImageMask false def} if
  464.     ImageMask
  465.     {/installfillcolor pdfpkgexec}
  466.     {    ColorSpace
  467.         dup isarray
  468.         {dup 0 get /Indexed eq {dup 1 2 copy get dup where {pop load} if put} if}
  469.         {dup where {pop load} if}
  470.         ifelse
  471.         /ColorSpace 1 index def
  472.         /pdfdebug where {/pdfdebug get} {false} ifelse
  473.         {    (imagecolorspace: ) print dup dup isarray {dup 0 get /Indexed eq {0 3 getinterval} if} if ==
  474.             (BitsPerComponent: ) print BitsPerComponent ==
  475.             flush
  476.         } if
  477.         /pkgsetcolorspace pdfpkgexec
  478.     }
  479.     ifelse
  480.     currentdict /Intent known
  481.     {Intent /pdfdebug where {/pdfdebug get} {false} ifelse {(Intent: ) print dup == flush} if ri} if
  482.     currentdict /Decode known not
  483.     {    /Decode
  484.         [    ImageMask
  485.             {0 1}
  486.             {    ColorSpace dup isarray {0 get} if /Indexed eq
  487.                 {0 2 BitsPerComponent exp 1 sub}
  488.                 {numcolorspacecomponents ColorSpace dup isarray {0 get} if get {0 1} repeat} ifelse
  489.             } ifelse
  490.         ] def
  491.     } if
  492.     L2 not
  493.     {    /pkgimagestripcnt Height pdfpkgput
  494.         /pkgimagebuf
  495.         Width ImageMask not
  496.         {    numcolorspacecomponents ColorSpace dup isarray {0 get} if get
  497.             mul BitsPerComponent mul
  498.         } if
  499.         7 add 8 idiv string pdfpkgput
  500.     } if
  501.     currentdict /DataSource known
  502.     {    L2 not
  503.         {    /DataSource load isarray not
  504.             {/DataSource dup load {pkgimagebuf readstring pop} aload length 1 add packedarray cvx def} if
  505.         } if
  506.     } 
  507.     {    L2
  508.         {    currentfile
  509.             currentdict /Filter known
  510.             {    Filter dup isarray {length} {pop 1} ifelse
  511.                 1 sub 0 1 3 -1 roll
  512.                 {    currentdict /DecodeParms known
  513.                     {DecodeParms dup isarray {1 index get} if dup null eq {pop} {exch} ifelse} if
  514.                     Filter dup isarray {exch get} {exch pop} ifelse
  515.                     filter
  516.                 } for
  517.             } if
  518.         }
  519.         {    currentdict /Filter known
  520.             {    Filter dup isarray
  521.                 {dup length 1 ne {(Image uses unsupported cascading filters: ) print flush Filter == flush quit} if 0 get} if
  522.                 /ASCIIHexDecode ne {(Image uses unsupported filter: ) print Filter == flush quit} if
  523.                 {    /pkgimagestripcnt pdfpkgget 0 gt
  524.                     {    currentfile pkgimagebuf readhexstring pop
  525.                         /pkgimagestripcnt dup pdfpkgget 1 sub dup 0 eq
  526.                         {{currentfile read {62 eq} {true} ifelse {exit} if} loop} if
  527.                         pdfpkgput
  528.                     }
  529.                     {()}
  530.                     ifelse
  531.                 }
  532.             }
  533.             {{currentfile pkgimagebuf readstring pop}}
  534.             ifelse
  535.         }
  536.         ifelse
  537.         /DataSource exch def
  538.     }
  539.     ifelse
  540.     currentdict ImageMask end {/pkgimagemask} {/pkgimage} ifelse pdfpkgexec
  541. } bind def
  542. /ID {buildimagedict DI} def
  543.  
  544.  
  545. /awidthparams {/TextWordSpacing pdfpkgget 0 32 /TextCharSpacing pdfpkgget 0 6 -1 roll} hardbind def
  546. /cshow where {pop} {/cshow {[0 0 5 -1 roll {exec} aload pop] cvx forall} hardbind def} ifelse
  547. /awidthcharpath    % cx cy char ax ay bool string awidthcharpath
  548. {    {    pop pop (0) dup 0 3 index put 2 index charpath
  549.         4 index eq {5 index 5 index rmoveto} if
  550.         2 index 2 index rmoveto
  551.     } exch cshow
  552.     pop pop pop pop pop pop
  553. } hardbind def
  554. /filltext {/installfillcolor pdfpkgexec awidthparams awidthshow} hardbind def
  555. /stroketext
  556. {    /installstrokecolor pdfpkgexec awidthparams false exch awidthcharpath
  557.     currentpoint cmtmpmat currentmatrix TextBaseMatrix setmatrix stroke setmatrix moveto
  558. } hardbind def
  559. /fillandstroketext {currentpoint 2 index filltext newpath moveto stroketext} hardbind def
  560. /appendtextpath {awidthparams false exch awidthcharpath} hardbind def
  561. /textprocs
  562. [/filltext load
  563. /stroketext load
  564. /fillandstroketext load
  565. {q nulldevice filltext currentpoint Q newpath moveto} hardbind
  566. {q dup filltext Q appendtextpath} hardbind
  567. {q dup stroketext Q appendtextpath} hardbind
  568. {q dup fillandstroketext Q appendtextpath} hardbind
  569. /appendtextpath load
  570. ] def
  571. /Tj {textprocs /TextRendering pdfpkgget get exec} hardbind def
  572. /inittextmatrix
  573. {    TextBaseMatrix setmatrix TextMatrix concat
  574.     0 /TextRise pdfpkgget translate /TextHScale pdfpkgget 1 scale
  575. } hardbind def
  576. /Tf {/TextSize 1 index pdfpkgput exch findfont exch scalefont setfont} hardbind def
  577. /Tw {/TextWordSpacing exch pdfpkgput} hardbind def
  578. /Tc {/TextCharSpacing exch pdfpkgput} hardbind def
  579. /TL {neg /TextLeading exch pdfpkgput} hardbind def
  580. /Ts {/TextRise exch pdfpkgput currentpoint inittextmatrix moveto} hardbind def
  581. /Tz {100 div /TextHScale exch pdfpkgput inittextmatrix} hardbind def
  582. /Tr
  583. {    /InText pdfpkgget {/TextRendering pdfpkgget 3 le {currentpoint newpath moveto} if} if
  584.     /pdfdebug where {/pdfdebug get} {false} ifelse {dup 0 ne {(TextRendering set to: ) print dup == flush} if} if
  585.     /TextRendering exch pdfpkgput
  586. } hardbind def
  587. /Td {cmtmpmat translate TextMatrix dup concatmatrix pop inittextmatrix 0 0 moveto} hardbind def
  588. /TD {/TextLeading 1 index pdfpkgput Td} hardbind def
  589. /T* {0 /TextLeading pdfpkgget Td} hardbind def
  590. /' {T* Tj} hardbind def
  591. /" {exch Tc exch Tw '} hardbind def
  592. /TJ {{dup type /stringtype eq {Tj} {1000 div /TextSize pdfpkgget mul neg 0 rmoveto} ifelse} forall} hardbind def
  593. /Tm {TextMatrix astore pop inittextmatrix 0 0 moveto} hardbind def
  594. /BT
  595. {    /InText true pdfpkgput
  596.     TextBaseMatrix currentmatrix pop TextMatrix identmatrix pop inittextmatrix newpath 0 0 moveto
  597. } hardbind def
  598. /ET
  599. {    /TextRendering pdfpkgget 3 gt {clip} if TextBaseMatrix setmatrix newpath
  600.     /InText false pdfpkgput
  601. } hardbind def
  602.  
  603. /reencodeenc null def
  604. /reencodeindex null def
  605. /reencode
  606. {    /reencodeenc exch pdfpkgput /reencodeindex 0 pdfpkgput
  607.     counttomark 1 sub -1 0
  608.     {    index dup type /nametype eq
  609.         {/reencodeenc pdfpkgget /reencodeindex pdfpkgget 3 -1 roll put /reencodeindex pdfpkgget 1 add} if
  610.         /reencodeindex exch pdfpkgput
  611.     } for
  612.     cleartomark /reencodeenc pdfpkgget
  613. } bind def
  614. /PredefinedEncodings
  615. [
  616. [39/quotesingle 96/grave 128/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis
  617. /Udieresis/aacute/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute
  618. /egrave/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde
  619. /oacute/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex
  620. /udieresis/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls
  621. /registered/copyright/trademark/acute/dieresis/.notdef/AE/Oslash
  622. /.notdef/plusminus/.notdef/.notdef/yen/mu/.notdef/.notdef
  623. /.notdef/.notdef/.notdef/ordfeminine/ordmasculine/.notdef/ae/oslash
  624. /questiondown/exclamdown/logicalnot/.notdef/florin/.notdef/.notdef
  625. /guillemotleft/guillemotright/ellipsis/.notdef/Agrave/Atilde/Otilde/OE/oe
  626. /endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide
  627. /.notdef/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright
  628. /fi/fl/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand
  629. /Acircumflex/Ecircumflex/Aacute/Edieresis/Egrave/Iacute/Icircumflex
  630. /Idieresis/Igrave/Oacute/Ocircumflex/.notdef/Ograve/Uacute/Ucircumflex
  631. /Ugrave/dotlessi/circumflex/tilde/macron/breve/dotaccent/ring/cedilla
  632. /hungarumlaut/ogonek/caron
  633. StandardEncoding 256 array copy reencode
  634. [1/dotlessi/caron 39/quotesingle 96/grave 
  635. 127/bullet/bullet/bullet/quotesinglbase/florin/quotedblbase/ellipsis
  636. /dagger/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE
  637. /bullet/bullet/bullet/bullet/quoteleft/quoteright/quotedblleft
  638. /quotedblright/bullet/endash/emdash/tilde/trademark/scaron
  639. /guilsinglright/oe/bullet/bullet/Ydieresis/space/exclamdown/cent/sterling
  640. /currency/yen/brokenbar/section/dieresis/copyright/ordfeminine
  641. /guillemotleft/logicalnot/hyphen/registered/macron/degree/plusminus
  642. /twosuperior/threesuperior/acute/mu/paragraph/periodcentered/cedilla
  643. /onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters
  644. /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
  645. /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
  646. /Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash
  647. /Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave
  648. /aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
  649. /ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde
  650. /ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute
  651. /ucircumflex/udieresis/yacute/thorn/ydieresis
  652. StandardEncoding 256 array copy reencode
  653. ] def
  654. /TZ
  655. {    3 1 roll findfont dup length 3 add dict begin
  656.     {1 index /FID ne {def} {pop pop} ifelse} forall
  657.     currentdict /OrigFontName known not
  658.     {/OrigFontName currentdict /FontName known {/FontName load} {1 index} ifelse def} if
  659.     /FontName exch def
  660.     dup 0 ge {/Encoding PredefinedEncodings 3 -1 roll get def} {pop} ifelse
  661.     counttomark 0 eq {pop} {/Encoding load 256 array copy reencode /Encoding exch def} ifelse
  662.     /FontName load currentdict end definefont pop
  663. } bind def
  664. /performfontsubstitution
  665. {    20 dict begin
  666.     /OrigFontName 3 -1 roll def
  667.     counttomark 2 add -1 roll exch 2 index counttomark 1 add 1 roll TZ
  668.     6 1 roll 5 index findfont 1000 scalefont
  669.     /_basefont exch def
  670.     /FontBBox exch def
  671.     /ItalicAngle exch def
  672.     /MissingWidth exch def
  673.     /Widths exch def
  674.     /FirstChar exch def
  675.     /NewItalicMatrix matrix def
  676.     /UnItalicMatrix matrix def
  677.     _basefont /FontInfo known
  678.     {    _basefont /FontInfo get /ItalicAngle known
  679.         {    ItalicAngle 0 eq {/ItalicAngle _basefont /FontInfo get /ItalicAngle get def} if
  680.             NewItalicMatrix 2 ItalicAngle dup 0 lt {neg} if dup sin exch cos div put
  681.             UnItalicMatrix 2 _basefont /FontInfo get /ItalicAngle get dup 0 gt {neg} if dup sin exch cos div put
  682.         } if
  683.     } if
  684.     /_basefont _basefont UnItalicMatrix makefont def
  685.     /FontType 3 def
  686.     /FontMatrix [0.001 0 0 0.001 0 0] def
  687.     /Encoding _basefont /Encoding get def
  688.     /fontbboxisnotallzero FontBBox {0 ne} forall or or or def
  689.     %fontbboxisnotallzero
  690.     %{    gsave NewItalicMatrix setmatrix
  691.     %    _basefont /FontMatrix get concat _basefont /FontBBox get aload pop
  692.     %    newpath 3 index 3 index moveto 1 index 3 index lineto 2 copy lineto 3 index 1 index lineto pop pop pop pop
  693.     %    matrix setmatrix pathbbox grestore
  694.     %    exch pop 3 -1 roll pop
  695.     %    FontBBox 3 get exch div exch FontBBox 1 get exch div
  696.     %    2 copy gt {exch} if pop
  697.     %    /pdfdebug where {/pdfdebug get} {false} ifelse
  698.     %    {    (Vertical adjustment for Font ) print
  699.     %        OrigFontName dup length string cvs print
  700.     %        (: ) print
  701.     %        dup == flush
  702.     %    } if
  703.     %    [1 0 0 5 -1 roll 0 0] _basefont exch makefont
  704.     %    /_basefont exch def
  705.     %} if
  706.     /BuildChar
  707.     {    exch begin
  708.         gsave _basefont setfont ( ) dup 0 3 index put dup stringwidth grestore
  709.         4 -1 roll FirstChar sub dup 0 ge 1 index Widths length lt and
  710.         {Widths exch get} {pop MissingWidth} ifelse dup 0 eq {pop 1 index} if
  711.         dup 4 -1 roll 1 index 0 ne 1 index 0 ne and {div} {pop pop 1} ifelse 3 1 roll exch
  712.         fontbboxisnotallzero
  713.         {FontBBox aload pop}
  714.         {    gsave NewItalicMatrix setmatrix 2 index 1 scale
  715.             _basefont /FontMatrix get concat _basefont /FontBBox get aload pop
  716.             newpath 3 index 3 index moveto 1 index 3 index lineto 2 copy lineto 3 index 1 index lineto pop pop pop pop
  717.             matrix setmatrix pathbbox grestore
  718.         }
  719.         ifelse
  720.         6 copy setcachedevice
  721.         newpath 3 index 3 index moveto 1 index 3 index lineto 2 copy lineto 3 index 1 index lineto clip
  722.         pop pop pop pop pop pop
  723.         NewItalicMatrix concat 1 scale _basefont setfont 0 0 moveto show
  724.         end
  725.     } hardbind def
  726.     currentdict end definefont pop
  727. } bind def
  728. /substfontifneeded
  729. {    1 index
  730.     /resourcestatus where {pop dup /Font resourcestatus {pop pop pop false} {true} ifelse} if
  731.     {dup findfont /FontName get ne} {false} ifelse
  732.     {performfontsubstitution} {TZ 6 {pop} repeat} ifelse
  733. } bind def
  734. /DeviceGray [/DeviceGray] def
  735. /DeviceRGB [/DeviceRGB] def
  736. /DeviceCMYK [/DeviceCMYK] def
  737. /DefaultGray /DeviceGray load def
  738. /DefaultRGB /DeviceRGB load def
  739. L2
  740. {    /DefaultCalRGB
  741.     [    /CIEBasedABC
  742.         2 dict begin
  743.         /MatrixLMN [.4124 .2126 .0193 .3576 .7152 .1192 .1805 .0722 .9505] def
  744.         /WhitePoint [0.9505 1 1.089] def
  745.         currentdict end
  746.     ] def
  747.     /DefaultCalGray
  748.     [    /CIEBasedA
  749.         2 dict begin
  750.         /MatrixLMN [.4124 .2126 .0193 .3576 .7152 .1192 .1805 .0722 .9505] def
  751.         /WhitePoint [0.9505 1 1.089] def
  752.         currentdict end
  753.     ] def
  754.     /initcalcs
  755.     {    /DefaultRGB where {/DefaultRGB get dup isarray {0 get} if} {/DeviceRGB} ifelse
  756.         /DeviceRGB eq {/DefaultRGB /DefaultCalRGB pdfpkgget pdfpkgput} if
  757.         /DeviceRGB /DefaultRGB load pdfpkgput
  758.         /DefaultGray where {/DefaultGray get dup isarray {0 get} if} {/DeviceGray} ifelse
  759.         /DeviceGray eq
  760.         {    /DefaultRGB load 1 get
  761.             dup dup /RangeABC known not exch dup /DecodeABC known not exch /MatrixABC known not and and
  762.             not {pop /DefaultCalGray pdfpkgget 1 get} {0 dict copy} ifelse
  763.             /CIEBasedA exch 2 array astore
  764.             /DefaultGray exch pdfpkgput
  765.         } if
  766.         /DeviceGray /DefaultGray load pdfpkgput
  767.         0 g 0 G
  768.     } def
  769.     /definecolorspaceresource {pdfpkgput} def
  770. }
  771. {    /initcalcs {} def
  772.     /definecolorspaceresource {pop pop} def
  773. }
  774. ifelse
  775. /beginpdf {pdfpkg begin 0 g 0 G []0 d 0 j 0 J 10 M 1 w 0 Tr} def
  776. /endpdf {end} def
  777. end
  778.  
  779. /currentpacking where {pop setpacking}if
  780.