Beruflich Dokumente
Kultur Dokumente
%
%
%
%
%
%
%
%
%
%
%
%
%
f
f
f
f
f
f
f
read4
read4
read2
read4
read2
read4
read2
(9) { f read2 dup =only /nb9 exch def } (# bits for content stream length delt
a) ptag
(10) { f read2 dup =only /nb10 exch def } (# bits for # of shared obj refs) pt
ag
(11) { f read2 dup =only /nb11 exch def } (# bits for shared obj indices) ptag
(12) { f read2 dup =only /nb12 exch def } (# bits for shared obj ref pos numer
ators) ptag
(13) { f read2 =only } (shared obj ref pos denominator) ptag
(*1) { [ npages { f nb3 readn } repeat ] ==only } (# objs/page deltas (see 1,3
)) ptag
(*2) { [ npages { f nb5 readn } repeat ] ==only } (# bytes/page deltas (see 4,
5)) ptag
(*3) { [ npages { f nb10 readn } repeat ] dup ==only /nso exch def } (# of sha
red obj refs (see 10)) ptag
(*4) { [ nso { [ exch { f nb11 readn } repeat ] } forall ] ==only } (shared ob
j indices (see 11)) ptag
(*5) { [ nso { [ exch { f nb12 readn } repeat ] } forall ] ==only } (shared ob
j ref pos numerators (see 12)) ptag
(*6) { [ npages { f nb7 readn } repeat ] ==only } (content stream offset-in-pa
ge deltas (see 6,7)) ptag
(*7) { [ npages { f nb9 readn } repeat ] ==only } (content stream length delta
s (see 8,9)) ptag
end
% temp dict
} bind def
% Print the Shared Objects Hint Table.
/psoht {
% <file> psoht 20 dict begin
/f exch def
readninit
(1) { f read4 =only } (first shared obj #) ptag
(2) { f read4 =only } (first shared obj offset (+PHS length if beyond PHS)) pt
ag
(3) { f read4 dup =only /n3 exch def } (# of p. 1 shared objs) ptag
(4) { f read4 dup =only /n4 exch def } (total # of shared objs) ptag
(5) { f read2 dup =only /nb5 exch def } (# bits for # of shared objs/group) pt
ag
(6) { f read4 =only } (least shared obj group length) ptag
(7) { f read2 dup =only /nb7 exch def } (# bits for shared obj group length de
lta) ptag
/nse n4 def
(*1) { [ nse { f nb7 readn
(see 6,7)) ptag
(*2) { [ nse { f 1 readn }
ptag
(*3:) = md5s {
0 ne {
( ) print f 16 string
(%stdout) (w) file dup
} if
} forall
(*4) { [ nse { f nb5 readn
end
% temp dict
readstring pop
3 -1 roll writehexstring closefile () =
} repeat ] ==only } (# objs/group (see 5)) ptag
} bind def
% Print the Primary Hint Stream of a PDF file.
/pphs {
% <file> pphs /pdf exch def
% Read the linearization parameter dictionary.
{ pdf pdftoken /obj eq { exit } if } loop
pdf pdftoken /lpdict exch def
/lpdict type /dicttype eq { lpdict /Linearized known } { false } ifelse {
(Not a linearized PDF file.) = stop
} if
lpdict plpdict flush
% Read the primary hint stream.
null {
pdf pdftoken dup /stream eq { pop exit } if
exch pop
} loop
/phsdict exch def
% Remove Length if indirect reference.
phsdict 0 known {
phsdict 0 undef phsdict /Length undef
} if
(PHS: ) print phsdict === flush
pdf 0 (endstream) /SubFileDecode filter
dup 64000 string readstring pop exch closefile
sread /phsdata exch def
% Decode the hint stream data if necessary.
phsdict /Filter .knownget {
phsdata exch filter
dup 5000 string readstring pop exch closefile
sread /phsdata exch def
} if
% Adobe says we can assume /P = 0.
(Page Offset Hint Table:) =
lpdict /N get
phsdata phsdict /S get string readstring pop sread
ppoht
(Shared Objects Hint Table:) =
phsdata psoht
} bind def
% Check for command line arguments.
[ shellarguments
{ ] dup length 1 eq
{ 0 get (r) file dup pphs closefile }
{ (Usage: pphs filename.pdf\n) print flush }
ifelse
}
{ pop }
ifelse