Professional Documents
Culture Documents
%
% 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 the license contained in the file LICENSE in this distribution.
%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
% pdf2ps copies the portion of this file from %BEGIN to %END if Level 1
% compatible output is requested.
/currentglobal where
{ pop currentglobal { setglobal } true setglobal }
{ { } }
ifelse
/packedarray where
{ pop }
{ /packedarray { array astore readonly } bind def }
ifelse
%BEGIN
% Note that the ColorSpace key must be present in the image dictionary.
/.colorspaceimage % <imagedict> .colorspaceimage -
{ save exch
dup length 15 add dict begin { cvlit def } forall
ColorSpace dup dup type /nametype ne { 0 get } if
.csncompdict exch get exec
/setpixelcolor exch def /ncomp exch def pop
/row ncomp BitsPerComponent mul Width mul 7 add 8 idiv string def
/mask 1 BitsPerComponent bitshift 1 sub def
/nextbits BitsPerComponent 8 eq
{ { row i get /i i 1 add def } }
{ /.csinextbits load }
ifelse def
/nextpixel mark 0 2 ncomp 1 sub 2 mul
{ /nextbits cvx exch
Decode exch 2 getinterval
dup aload pop exch sub
dup mask eq { pop } { mask div /mul load 3 -1 roll } ifelse
0 get dup 0 eq { pop } { /sub load 3 -1 roll } ifelse
}
for
/setpixelcolor load dup type /operatortype ne { /exec load } if
.packtomark cvx def
/readrow
/DataSource load dup type
dup /arraytype eq exch /packedarraytype eq or
{ % Must be { <file> <string> ... }
aload length 1 add array /pop load exch astore
dup 1 row put cvx
}
{ pop
% Adobe requires readstring to signal an error if given
% an empty string. Work around this nonsense here.
row length 0 eq
{ { } }
{ { DataSource row readstring pop pop } }
ifelse
}
ifelse def
ImageMatrix matrix invertmatrix concat
/imat matrix def
0 1 Height 1 sub
{ imat 5 3 -1 roll neg put
readrow
/b 0 def /nnb 0 def /i 0 def
0 1 Width 1 sub
{ imat 4 3 -1 roll neg put nextpixel
1 1 true imat {<80>} imagemask
}
for
}
for
end restore
} bind def
%END
exec
currentfile closefile
exec