home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 September
/
PCWK996.iso
/
sharewar
/
95
/
narzedzi
/
ambra
/
ambr32a1.exe
/
FILE
/
ARCHIVE.Z
/
ACROBAT
/
VIEWER32.EXE
/
PSPROCSET
/
8
< prev
next >
Wrap
Text File
|
1996-02-22
|
3KB
|
115 lines
%%BeginFile: pdfimg1b.prc
%%Copyright: Copyright 1987-1993 Adobe Systems Incorporated. All Rights Reserved.
% PDF Image Operators for Level 1 (Black and White)
PDF /PDFImage get begin
Level2? not StartLoad {
% The PDFImages dictionary contains image colorspace handlers.
PDFIVars /PDFImages 4 dict put
% Utility funciton: InstallImage
% Installs an image colorspace handler into the emulation.
/InstallImage {
PDFIVars /PDFImages get 3 1 roll put
} bd
% Utility functions: ColorComps? and ColorProc?
% Obtain the number of color components and the image procedure for a
% particular colorspace.
/ColorComps? {
dup type /arraytype eq { 0 get } if /PDFImages gv exch get 0 get
} bd
/ColorProc? {
dup type /arraytype eq { 0 get } if /PDFImages gv exch get 1 get
} bd
% Utility function: ImageFilter
% Determines the appropriate procedure to use with the image operator based
% on the DataSource and Filter attributes in the image dictionary
/ImageFilter {
/DataSource here {
pop [ DataSource ] cvx
}
{
% The only valid filter for Level 1 is ASCIIHexDecode.
% If Filter is not specified then the default is no filter,
% which indicates binary data.
/Filter here {
dup type /arraytype eq {
dup length 1 ne {
(Image uses unsupported cascading filters: ) print Filter == quit
} {
aload pop
} ifelse
} if
/ASCIIHexDecode ne {
(Image uses unsupported filter: ) print Filter == quit
} {
[ currentfile /CIBuffer gv /readhexstring cvx
/pop cvx ] cvx bind
} ifelse
} {
[ currentfile /CIBuffer gv /readstring cvx /pop cvx ] cvx bind
} ifelse
} ifelse % /DataSource here not
} bd
% Image data
/ID { % Image Node Contents
5 counttomark 2 idiv % Number of key value pairs
dup 3 1 roll add % Additional entries requested
dict begin % Create the dictionary
{ def } repeat % Def the key-value pairs into dict
cleartomark % Get rid of the mark
currentdict % Put the dictionary on the stack
end
PDFIVars begin begin
% Establish default attributes if necessary
/ImageMatrix [ Width 0 0 Height neg 0 Height ] def
% Define ColorSpace since ColorComps?, ColorProc? need it
% Doesn't actually affect current color
/ColorSpace here { pop }
{ /ColorSpace /DeviceGray def } ifelse
% Calculate the buffer length in bytes:
% ((Width * bpc * ncc) + 7) / 8
Width BitsPerComponent mul ColorSpace ColorComps? mul
7 add 8 idiv
string /CIBuffer exch pv
% Now run the image
ColorSpace ColorProc? exec
/Filter here { % An ASCIIHex filter has a > terminator.
pop
{
currentfile read { 62 eq { exit } if } { exit } ifelse
} loop % Get rid of hex EOD, YUCK!
} if
end end
} bd
% Install the image DeviceGray colorspace handler.
/DeviceGray [ 1
{
/ImageMask here not { false } if
{
sfc % set Illustrator fill color
Width Height
/Decode here { 0 get 1 eq } { false } ifelse
ImageMatrix ImageFilter imagemask
} {
Width Height BitsPerComponent ImageMatrix
ImageFilter image
} ifelse
} bind
] InstallImage
} EndLoad
end % PDFImage
%%EndFile