|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .currentglobal true .setglobal
- /pdfoptdict 200 dict def
- pdfoptdict begin
-
-
-
-
-
-
-
-
-
-
- /ifdaelse {
- 3 index type dup /dicttype eq {
- pop pop pop
- } {
- dup /arraytype ne exch /packedarraytype ne and {
- exch
- } if pop exch pop
- } ifelse exec
- } bind def
-
-
- /darray {
- dict
- } bind def
- /dadd {
- 1 index length exch put
- } bind def
- /daforall {
- /exch cvx /get cvx 3 -1 roll /exec cvx 5 packedarray cvx
- 0 1 2 index 0 get length 1 sub 4 -1 roll for
- } bind def
- /dacontents {
- [ exch { } daforall ]
- } bind def
- /dacontstring {
- 0 1 index { exch pop length add } forall string
- dup /NullEncode filter
-
- 3 -1 roll { 1 index exch writestring } daforall
- closefile
- } bind def
-
-
- /omforcenew {
- dup oforce 2 copy eq { pop true } { exch 0 get omapnew exch pop } ifelse
- } bind def
- /omforce {
- omforcenew pop
- } bind def
- /omget {
- get omforce
- } bind def
-
- /omvisit {
- omforcenew {
- { { omvisit omvisit } forall }
- { { omvisit } forall }
- { pop }
- ifdaelse
- } {
- pop
- } ifelse
- } bind def
-
-
- /omvisitnopage {
- dup oforce dup type /dicttype eq {
- /Type .knownget { /Page eq } { false } ifelse
- } {
- pop false
- } ifelse {
- pop
- } {
- omforcenew {
- { { omvisitnopage omvisitnopage } forall }
- { { omvisitnopage } forall }
- { pop }
- ifdaelse
- } {
- pop
- } ifelse
- } ifelse
- } bind def
-
-
- /omapped {
- RMap ld_length larray exch lgrowto
- RMap {
- 2 index 3 1 roll 1 sub exch lput
- } ld_forall
- } bind def
-
-
- /visited {
- false currentomap 2 .execn
- omapped exch setomap
- } bind def
-
-
-
-
- .currentglobal false .setglobal
- userdict /clostreams 20 dict put
- .setglobal
-
- /clostream {
- 2 index 3 -1 roll /exec load 3 packedarray cvx
- /NullEncode filter
-
- clostreams 1 index 5 -2 roll 2 array astore put
- } bind def
-
- /closend {
- dup closefile clostreams exch
- 2 copy get 3 1 roll undef aload pop exec
- } bind def
-
-
- /msproc {
- 3 -1 roll dadd { 100 string } { () } ifelse
- } bind def
- /mstream {
- 10 darray {msproc} {dacontstring} clostream
- } bind def
- /mcontents {
- closend
- } bind def
-
-
-
- /posbuf 100 string def
- /posproc {
- 0 2 copy get 5 -1 roll length add put
- pop //posbuf
- } bind def
- /postream {
- [0] {posproc} {0 get} clostream
- } bind def
- /poslength {
- closend
- } bind def
-
-
-
- /bitstream {
- 4 dict begin /S exch def /N 8 def /B 0 def
- currentdict end
- } bind def
- /bitwrite {
- PDFOPTDEBUG { ( ) print 1 index =only (:) print dup = } if
- 3 -1 roll begin
- N exch sub dup 0 ge {
- /N exch def N bitshift B add
- } {
- 2 copy bitshift B add S exch write
-
- { 8 add dup 0 ge { exit } if
- 2 copy bitshift 255 and S exch write
- } loop
- /N 1 index def bitshift 255 and
- } ifelse /B exch def
- end
- } bind def
- /bitflush {
- begin N 8 ne { S B write /B 0 def /N 8 def } if end
- } bind def
-
- /bwn {
- 2 copy
- 2 exch exp ge {
- /bwn cvx /rangecheck signalerror
- } if
- bits 3 1 roll bitwrite
- } def
-
-
- /totemp {
- TFile fileposition OFile
- /OFile TFile def 3 .execn
- /OFile exch def
- TFile fileposition
- } bind def
- /tomemory {
- OFile /OFile mstream def 2 .execn
- OFile mcontents exch /OFile exch def
- } bind def
- /tolength {
- OFile /OFile postream def 2 .execn
- OFile poslength exch /OFile exch def
- } bind def
-
-
- /copyrange {
- TFile 2 index setfileposition
- exch sub 1024 string exch {
-
- 2 copy 1 index length .min 0 exch getinterval
- TFile exch readstring pop OFile exch writestring
- 1 index length sub dup 0 le { exit } if
- } loop pop pop
- } bind def
-
-
- /padto {
- OFile fileposition sub
- dup 0 lt {
- (ERROR: file position incorrect by ) print =
- /padto cvx /rangecheck signalerror
- } {
- { ( ) ows } repeat
- } ifelse
- } bind def
-
-
-
- /touch {
- {
- { touch touch } forall
- } {
- dup xcheck {
-
- dup 0 get resolved? { pop pop } { oforce touch } ifelse
- } {
- { touch } forall
- } ifelse
- } {
- pop
- } ifdaelse
- } bind def
-
-
-
- /replaceable? {
- dup type /integertype eq exch xcheck not and
- } bind def
- /replacement {
- dup oforce dup replaceable? { exch } if pop
- } bind def
-
- /replacerefs {
- {
- dup {
- 2 index 2 index undef
- exch replacement exch replacement
- 2 index 3 1 roll put
- } forall
- } {
- 0 1 2 index length 1 sub {
- 1 index exch 2 copy get replacement put
- } for
- } {
- } ifdaelse
- } bind def
-
- /replaceReferences {
- Objects { replacerefs pop } lforall
-
- 0 1 Objects llength 1 sub {
- Objects 1 index lget replaceable? {
- PDFOPTDEBUG { (Deleting ) print dup = } if
- Generations 1 index 0 lput
- } if pop
- } for
- } bind def
-
-
-
- /createObjects {
- Objects llength dup
- dup 3 index length add growPDFobjects
-
- 3 1 roll exch {
- Objects 2 index 3 -1 roll lput
- Generations 1 index 1 lput
- 1 add
- } forall pop
- } bind def
-
-
-
- /nopropattrs <<
-
- /Type dup /Kids dup /Count dup /Parent dup
-
- /Resources dup
- >> def
-
-
- /mergeres {
-
- 1 index /Resources .knownget {
- 1 index /Resources .knownget {
-
- exch oforce exch oforce
-
- dup length dict .copydict
- exch {
-
- 2 index 2 index knownoget {
-
- exch oforce exch
-
- dup type /dicttype eq {
-
- exch dup length 2 index length add dict .copydict .copydict
- } {
-
-
- dup length 2 index length add dict begin
- exch { dup def } forall { dup def } forall
- mark currentdict end { pop } forall .packtomark
- } ifelse
- } if
- 2 index 3 1 roll put
- } forall
- } if /Resources exch put pop
- } {
- pop pop
- } ifelse
- } bind def
-
-
- /mergeattrs {
-
- 1 index {
-
- //nopropattrs 2 index known {
- pop pop
- } {
- 2 index 2 index known { pop pop } { 2 index 3 1 roll put } ifelse
- } ifelse
- } forall
- } bind def
-
-
- /proppage {
-
-
-
-
- dup /Kids knownoget {
-
- 3 1 roll
-
- dup length dict .copydict mergeattrs
- dup 3 1 roll mergeres
- exch { oforce 1 index exch proppage } forall pop
- } {
-
- mergeattrs mergeres
- } ifelse
- } bind def
-
-
- /propagateAttributes {
- 0 dict Trailer /Root oget /Pages oget proppage
- } bind def
-
-
-
- /identifyDocumentObjects {
- {
- Trailer /Root omget
- dup /PageMode .knownget { omvisit } if
-
- dup /OpenAction .knownget { omvisitnopage } if
- Trailer /Encrypt .knownget { omvisit } if
- dup /Threads .knownget {
- omforce dup //null ne { { omvisitnopage } forall } { pop } ifelse
- } if
- dup /AcroForm .knownget { omvisitnopage } if
- pop
- } visited
- } bind def
-
-
-
- /identifyfont {
- omforce {
- exch /FontDescriptor eq {
- omforce dup /Flags .knownget { 32 and 0 ne } { false } ifelse
- exch {
- exch dup dup /FontFile eq exch /FontFile2 eq or
- exch /FontFile3 eq or 2 index and {
- fontfiles exch dadd
- } {
- omvisit
- } ifelse
- } forall pop
- } {
- omvisit
- } ifelse
- } forall
- } bind def
-
-
-
- /identifyPageObjects {
- PDFOPTDEBUG {
- (
- } if
- pdffindpageref
- dup 0 get 3 1 roll
- 4 dict begin
- /filter_params 10 darray def
- /images 10 darray def
- /fontfiles 10 darray def
- {
- omforce
-
-
- exch omvisitnopage
-
-
- dup /Annots .knownget { omvisitnopage } if
-
- dup /B .knownget { omvisitnopage } if
-
- dup /Resources .knownget {
- omforce dup {
-
- omforce pop pop
- } forall {
-
-
-
-
-
- exch dup /XObject eq {
- pop oforce {
- dup oforce /Subtype get /Image eq {
- dup oforce /DecodeParms .knownget {
- oforce {
- exch /JBIG2Globals eq {
- filter_params exch dadd
- } {
- pop
- } ifelse
- } forall
- } if
- images exch dadd
- } {
- omvisit
- } ifelse pop
- } forall
- } {
- /Font eq {
- oforce { identifyfont pop } forall
- } {
- oforce omvisit
- } ifelse
- } ifelse
- } forall
- } if
-
- dup /Contents .knownget { omvisit } if
-
-
- filter_params { omvisit } daforall
- images { omvisit } daforall
-
-
- fontfiles { omvisit } daforall
- pop
- } visited end
-
- [ 3 1 roll {
- 2 copy eq { pop } { exch } ifelse
- } lforall counttomark 1 roll ]
- PDFOPTDEBUG {
- (
- } if
- } bind def
-
-
- /identifyFirstPageObjects {
- Trailer /Root oget null
- 1 index /PageMode knownoget {
- /UseOutlines eq {
- 1 index /Outlines knownoget { exch pop } if
- } if
- } if exch pop
- 1 identifyPageObjects
- } bind def
-
-
-
-
-
-
- /identifyOtherPageObjects {
-
- 4 dict begin
- /marks lstring Objects llength lgrowto def
-
- [ 2 1 pdfpagecount { null exch identifyPageObjects } for ]
- dup {
- { marks exch 2 copy lget 1 add 254 .min lput } forall
- } forall
-
- CatalogNs { marks exch 255 lput } lforall
- FirstPageNs { marks exch 255 lput } forall
-
- dup {
- 0 get marks exch 1 lput
- } forall
-
- dup
- [ exch {
- [ exch {
- marks 1 index lget 1 ne { pop } if
- } forall ]
- } forall ]
-
- exch
- [ exch {
- [ exch {
- marks 1 index lget dup 1 le exch 255 eq or { pop } if
- } forall ]
- } forall ]
-
-
- [ 1 1 marks llength 1 sub {
- marks 1 index lget dup 1 le exch 255 eq or { pop } if
- } for ]
-
- end
- } bind def
-
-
- /identifyNonPageObjects {
- 4 dict begin
- /marks lstring Objects llength lgrowto def
-
- LPDictN marks exch 1 lput
- PHSN marks exch 1 lput
- CatalogNs { marks exch 1 lput } lforall
- FirstPageNs { marks exch 1 lput } forall
- SharedNs { marks exch 1 lput } forall
- OtherPageNs { { marks exch 1 lput } forall } forall
-
-
- /npobj larray
- 0
- 1 1 Objects llength 1 sub {
- marks 1 index lget 0 eq {
- Generations exch lget 0 ne { 1 add } if
- } {
- pop
- } ifelse
- } for
- lgrowto def
-
- 0
- 1 1 Objects llength 1 sub {
- marks 1 index lget 0 eq {
-
- Generations 1 index lget 0 ne {
-
- npobj 2 index
- 3 -1 roll
- lput 1 add
- } {
- pop
- } ifelse
- } {
- pop
- } ifelse
- } for
- pop
-
- npobj
- end
- } bind def
-
-
-
-
-
- /assignObjectNumbers {
- OtherPageNs { { omap pop } forall } forall
- SharedNs { omap pop } forall
- NonPageNs { omap pop } lforall
-
- LPDictN omap
- CatalogNs { omap pop } lforall
- FirstPageNs { omap pop } forall
- PHSN omap pop
- } bind def
-
-
-
-
- /createLPDict {
-
- LPDict
- dup /Linearized 1 put
- dup /L 4 -1 roll put
- dup /T 4 -1 roll put
- dup /E 4 -1 roll put
- dup /H 5 -2 roll 1 index sub 2 array astore put
- dup /O 1 pdffindpageref 0 get omap put
- /N pdfpagecount put
- } bind def
-
-
-
- /adjustObjectPositions {
-
-
-
- XRef {
-
- dup 5 index ge { 2 } { 3 } ifelse index add
- XRef 3 1 roll ld_put
- } ld_forall pop pop pop
- XRef LPDictN omap HeaderLength ld_put
- XRef PHSN omap PHSStart ld_put
- } bind def
-
-
-
-
- /writeobjn {
- Generations 1 index lget pdfwriteobj
- } bind def
- /writeobjns {
- { writeobjn } forall
- } bind def
- /lwriteobjns {
- { writeobjn } lforall
- } bind def
-
-
- /writePart {
- PDFOPTDEBUG {
- dup print ( count=) print count =only ( start=) print
- OFile { .fileposition } stopped { pop (???) } if =
- 2 .execn
- print ( end=) print
- OFile { .fileposition } stopped { pop (???) } if =
- } {
- pop exec
- } ifelse
- } bind def
-
-
- /writePart1 {
- {
- pdfwriteheader
- } (part1) writePart
- } bind def
-
-
- /writePart2 {
- {
- LPDictN writeobjn
- } (part2) writePart
- } bind def
-
-
-
- /writePart3 {
- {
- FirstPageXN NObjects 1 add 1 index sub pdfwritexref
- Trailer dup length 1 add dict copy Trailer xcheck { cvx } if
- dup /Size NObjects 1 add put
- dup /Prev 4 -1 roll put
- pdfwritetrailer
- 0 pdfwritestartxref
- } (part3) writePart
- } bind def
-
-
-
- /writePart4 {
- {
- CatalogNs lwriteobjns
- } (part4) writePart
- } bind def
-
-
- /writePart5 {
- {
- PHSN writeobjn
- } (part5) writePart
- } bind def
-
-
-
- /writePart6 {
- {
- FirstPageNs writeobjns
- } (part6) writePart
- } bind def
-
-
-
- /writePart7 {
- {
- [ OtherPageNs {
- OFile fileposition exch
- writeobjns OFile fileposition exch sub
- } forall ]
- } (part7) writePart
- } bind def
-
-
-
- /writePart8 {
- {
- SharedNs writeobjns
- } (part8) writePart
- } bind def
-
-
-
- /writePart9 {
- {
- NonPageNs { writeobjn } lforall
- } (part9) writePart
- } bind def
-
-
-
- /writePart11xref {
- {
- 0 FirstPageXN pdfwritexref
- } (part11xref) writePart
- } bind def
- /writePart11rest {
- {
- << /Size FirstPageXN >> pdfwritetrailer
- pdfwritestartxref
- } (part11rest) writePart
- } bind def
-
-
-
- /bitsneeded {
- 0 exch { dup 0 eq { pop exit } if exch 1 add exch 2 idiv } loop
- } bind def
-
-
- /omstart {
- PDFOPTDEBUG { (start\() print dup =only } if
- omap
- PDFOPTDEBUG { (=>) print dup =only } if
- XRef exch ld_get
- PDFOPTDEBUG { (\) = ) print dup = } if
- } bind def
- /omend {
-
-
-
- PDFOPTDEBUG { (end\() print dup =only } if
- omap
- PDFOPTDEBUG { (=>) print dup =only } if
- 1 add
-
-
- PHSN omap 1 index eq { pop 1 } if
- XRef exch ld_get
- PDFOPTDEBUG { (\) = ) print dup = } if
- } bind def
- /omlength {
- dup omend exch omstart sub
- } bind def
-
-
- /contentsobjects {
-
- /Contents .knownget {
- dup oforce
- dup type /dicttype eq {
- pop 0 get dup true
- } {
- exch pop
- dup length 0 ne {
- dup 0 get 0 get
- exch dup
- length 1 sub get 0 get
- true
- } {
- pop false
- } ifelse
- } ifelse
- } {
- false
- } ifelse
- } bind def
-
- /contentsstart {
-
- contentsobjects { pop omstart true } { false } ifelse
- } bind def
-
- /contentslength {
- contentsobjects { omend exch omstart sub } { 0 } ifelse
- } bind def
-
-
- /writePageOffsetHints {
- PDFOPTDEBUG { /writePageOffsetHints == } if
- 20 dict begin
- /bits OFile bitstream def
-
-
- FirstPageLength OtherPageLengths { .min } forall
- /minpl exch def
-
-
- FirstPageNs 0 get Objects exch lget contentslength
- OtherPageNs { 0 get Objects exch lget contentslength .min } forall
- /mincl exch def
-
-
-
- /mincl 0 def
-
-
- FirstPageLength OtherPageLengths { .max } forall
- minpl sub bitsneeded /maxplbits exch def
-
- FirstPageNs 0 get Objects exch lget contentslength
- OtherPageNs { 0 get Objects exch lget contentslength .max } forall
- mincl sub bitsneeded /maxclbits exch def
-
-
-
- maxplbits maxclbits .max /maxplbits 1 index def /maxclbits exch def
-
-
- /shared_id_dict FirstPageNs length SharedNs length add dict begin
- 0 FirstPageNs { 1 index def 1 add } forall
- SharedNs { 1 index def 1 add } forall
- pop
- currentdict end def
-
-
-
-
- FirstPageNs length OtherPageNs { length .min } forall
- /minnop 1 index def 32 bwn
-
- FirstPageNs 0 get omap XRef exch ld_get 32 bwn
-
- FirstPageNs length OtherPageNs { length .max } forall
- minnop sub bitsneeded /maxnopbits 1 index def 16 bwn
-
- minpl 32 bwn
-
- maxplbits 16 bwn
-
- 0
- /minsco 1 index def 32 bwn
-
-
- 0
- /maxscobits 1 index def 16 bwn
-
- mincl 32 bwn
-
- maxclbits 16 bwn
-
-
- FirstPageNs length SharedPageNs { length .max } forall bitsneeded
- /maxsorbits 1 index def 16 bwn
-
- FirstPageNs length SharedNs length add bitsneeded
- /sobits 1 index def 16 bwn
-
- 2
- /numfbits 1 index def 16 bwn
-
- 1
- /denf 1 index def 16 bwn
-
-
-
-
- FirstPageNs length minnop sub maxnopbits bwn
- OtherPageNs {
- length minnop sub maxnopbits bwn
- } forall
- bits bitflush
-
-
- FirstPageLength minpl sub maxplbits bwn
- OtherPageLengths {
- minpl sub maxplbits bwn
- } forall
- bits bitflush
-
-
- FirstPageNs length maxsorbits bwn
- SharedPageNs { length maxsorbits bwn } forall
- bits bitflush
-
- FirstPageNs { shared_id_dict exch get sobits bwn } forall
- SharedPageNs {
- { shared_id_dict exch get sobits bwn
- } forall
- } forall
- bits bitflush
-
-
- FirstPageNs { pop 0 numfbits bwn } forall
- SharedPageNs {
- { pop 0 numfbits bwn
- } forall
- } forall
- bits bitflush
-
-
-
- maxscobits 0 gt {
- [FirstPageNs OtherPageNs aload pop] {
- 0 get Objects exch lget contentsstart { minsco sub } { 0 } ifelse
- maxscobits bwn
- } forall
- bits bitflush
- } if
-
-
- [FirstPageNs OtherPageNs aload pop] {
- 0 get Objects exch lget contentslength mincl sub maxclbits bwn
- } forall
- bits bitflush
-
- end
-
- } bind def
-
- /writeSharedObjectHints {
- PDFOPTDEBUG { /writeSharedObjectHints == } if
- 20 dict begin
- /bits OFile bitstream def
- /obj_count SharedNs length FirstPageNs length add def
-
-
-
-
- 0 32 bwn
-
-
-
-
- { pdfwriteheader } tomemory length 32 bwn
-
- FirstPageNs length 32 bwn
-
-
- obj_count 32 bwn
-
-
-
- 0 16 bwn
-
- 16#7fffffff FirstPageNs { omlength .min } forall
- SharedNs { omlength .min } forall
- /minsol 1 index def 32 bwn
-
-
- 0 FirstPageNs { omlength .max } forall
- SharedNs { omlength .max } forall
- minsol sub bitsneeded
- /maxsolbits 1 index def 16 bwn
-
-
-
-
- FirstPageNs { omlength minsol sub maxsolbits bwn } forall
- SharedNs { omlength minsol sub maxsolbits bwn } forall
- bits bitflush
-
- obj_count { 0 1 bwn } repeat
- bits bitflush
-
-
-
- end
- } bind def
-
-
-
- /pdfOptimize {
- realtime 3 1 roll
- exch pdfdict begin pdfopenfile dup begin
- 40 dict begin
- /IDict exch def
- /OFile exch def
- /starttime exch def
- /ToWrite 100 dict def
- /now {
- QUIET { pop } { print (, t = ) print realtime starttime sub = flush } ifelse
- } def
- omapinit
-
-
-
-
-
- null (w+) .tempfile /TFile exch def /TFileName exch def
- .setsafe
-
-
-
- Trailer touch
- (Read objects) now
-
-
- Trailer /Encrypt known {
- (ERROR: Encrypted files are not yet supported.) = flush
- /pdfOptimize cvx /limitcheck signalerror
- } if
-
-
-
-
- replaceReferences
- (Replaced references) now
-
-
-
-
- /LPDict 10 dict def
- /PHS 10 dict cvx def
- [LPDict PHS] createObjects
- /LPDictN 1 index def 1 add
- /PHSN exch def
- PDFOPTDEBUG { << /LPDictN LPDictN /PHSN PHSN >> === } if
-
-
-
- 0 0 1 Objects llength 1 sub {
- Generations exch lget 0 ne { 1 add } if
- } for
- /NObjects exch def
- QUIET not { NObjects =only ( objects total) = flush } if
-
-
-
- propagateAttributes
- (Propagated attributes) now
-
-
-
- identifyDocumentObjects /CatalogNs exch def
- QUIET not { CatalogNs === flush } if
- (Identified Catalog) now
-
-
-
-
- pdfopencache
- /FirstPageNs identifyFirstPageObjects def
- QUIET not { FirstPageNs === flush } if
- (Identified first page) now
-
-
-
-
- identifyOtherPageObjects
- /SharedNs exch def
- /SharedPageNs exch def
- /OtherPageNs exch def
- QUIET not { OtherPageNs === flush SharedNs === flush } if
- (Identified other pages) now
-
-
-
- /NonPageNs identifyNonPageObjects def
- QUIET not { NonPageNs { === } forall flush } if
- (Identified non-pages) now
-
-
-
-
- /FirstPageXN assignObjectNumbers def
- (Assigned objects #s) now
-
-
-
- { writePart4 } totemp
- /CatalogTempEnd exch def /CatalogTempStart exch def
- (Wrote Catalog) now
-
-
-
- { writePart6 } totemp
- /FirstPageTempEnd exch def /FirstPageTempStart exch def
- (Wrote first page) now
-
-
-
- { writePart7 /OtherPageLengths exch def } totemp
- /OtherPageTempEnd exch def /OtherPageTempStart exch def
- (Wrote other pages) now
-
-
-
- { writePart8 } totemp
- /SharedTempEnd exch def /SharedTempStart exch def
- (Wrote shared objects) now
-
-
-
- { writePart9 } totemp
- /NonPageTempEnd exch def /NonPageTempStart exch def
-
-
-
-
-
- XRef LPDictN omap 0 ld_put
- XRef PHSN omap 0 ld_put
-
- /HeaderLength {
- writePart1
- } tolength def
- /CatalogLength
- CatalogTempEnd CatalogTempStart sub def
- /FirstPageLength
- FirstPageTempEnd FirstPageTempStart sub def
- /OtherObjectsLength
- NonPageTempEnd OtherPageTempStart sub def
- /ObjectsLength
- CatalogLength FirstPageLength add OtherObjectsLength add def
- /XrefLength {
-
-
- writePart11xref 1024 writePart11rest
- } tolength def
- /NominalFileLength
- HeaderLength ObjectsLength 3 mul add 10000 add 99999 .max def
- /FirstPageXrefLength {
- NominalFileLength writePart3
- } tolength def
- /LPDictLength {
- NominalFileLength dup 2 mul 2 copy add 1 index dup createLPDict writePart2
- } tolength def
-
-
-
- /XrefBeginLength {
- (xref\n0 ) ows
- OFile FirstPageXN write=
- } tolength def
- HeaderLength LPDictLength add
- /FirstPageXrefStart 1 index def
- FirstPageXrefLength add
- /CatalogStart 1 index def
- CatalogLength add
- /PHSStart exch def
-
-
-
-
- 0 0 CatalogStart CatalogTempStart sub adjustObjectPositions
-
- XRef PHSN omap CatalogStart ld_put
- (Adjusted positions) now
-
-
-
- { writePageOffsetHints } totemp
- pop /PHSTempStart exch def
- { writeSharedObjectHints } totemp
- exch PHSTempStart sub PHS /S 3 -1 roll put
- PHSTempStart sub /PHSTempLength exch def
- (Wrote hints) now
-
-
-
-
-
- PHS
- dup /File TFile put
- dup /FilePosition PHSTempStart put
- dup /Length PHSTempLength put
- pop
- /PHSLength { writePart5 } tolength def
-
-
-
- PHSStart
- dup PHSLength add
- /FirstPageStart 1 index def
- dup FirstPageLength add
- dup OtherObjectsLength add
- /XrefStart 1 index def
- XrefBeginLength add
- dup XrefBeginLength sub XrefLength add
-
-
-
- 4096 .max
- /FileLength 1 index def
- createLPDict
-
-
-
- PHSStart 0 PHSLength adjustObjectPositions
- (Readjusted positions) now
-
-
-
- writePart1
- writePart2
- FirstPageXrefStart padto
- XrefStart writePart3
- CatalogStart padto
- CatalogTempStart CatalogTempEnd copyrange
- writePart5
- FirstPageStart padto
- FirstPageTempStart NonPageTempEnd copyrange
-
- XrefStart padto
- writePart11xref
- { FirstPageXrefStart writePart11rest } tomemory
- FileLength 1 index length sub padto ows
- (Wrote output file) now
-
-
-
- TFile closefile TFileName deletefile
- end
- end
- } bind def
-
- end
- .setglobal
-
-
- [ shellarguments {
- ] dup length 2 eq {
-
- /omapinit where { pop } { (pdfwrite.ps) runlibfile } ifelse
- save exch
- aload pop exch (r) file exch (w) file
- 3000000 setvmthreshold
- 0 setobjectformat
- pdfoptdict begin pdfOptimize end
- restore
- } {
- (Usage: gs -dNODISPLAY -- pdfopt.ps input.pdf output.pdf) = flush quit
- } ifelse
- } {
- pop
- } ifelse
|