2 eval 'exec perl -S $0 "$@"'
3 if $running_under_some_shell;
5 # This is html2ps version 1.0 beta3, an HTML-to-PostScript converter.
6 # Copyright (C) 1995-2000 Jan Karrman.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 # Author: Jan Karrman, Dept. of Scientific Computing, Uppsala University,
23 # Sweden, e-mail: jan@tdb.uu.se.
26 # Set the name of the global configuration file. See the installation notes
27 # and manual page for more details on configuration files.
29 $globrc='/usr/local/lib/html2ps/html2psrc';
30 $ug='/usr/local/lib/html2ps/html2ps.html';
61 encoding: "ISO-8859-1";
117 open: "« ";
118 close: " »";
133 heading: "<H1>Table of Contents</H1>";
138 content: "<DIV align=center>
139 <H1><BIG>$T</BIG></H1>
140 <H2>$[author]</H2></DIV>";
150 new-century-schoolbook {
151 names: "NewCenturySchlbk-Roman
152 NewCenturySchlbk-Italic
153 NewCenturySchlbk-Bold
154 NewCenturySchlbk-BoldItalic";
160 Helvetica-BoldOblique";
163 names: "Helvetica-Narrow
164 Helvetica-Narrow-Oblique
165 Helvetica-Narrow-Bold
166 Helvetica-Narrow-BoldOblique";
169 names: "Palatino-Roman
172 Palatino-BoldItalic";
175 names: "AvantGarde-Book
176 AvantGarde-BookOblique
178 AvantGarde-DemiOblique";
181 names: "Bookman-Light
190 Courier-BoldOblique";
212 font-family: Helvetica;
229 font-family: Helvetica;
249 font-family: Helvetica;
272 html2psrc: "$HOME/.html2psrc";
274 datefmt: "%e %b %Y %R";
276 doc-sep: "<!--NewPage-->";
299 H1, H2, H3, H4, H5, H6 {
302 margin-bottom: 0.5em;
304 H1 { font-size: 19pt }
305 H2 { font-size: 17pt }
306 H3 { font-size: 15pt }
307 H4 { font-size: 13pt }
308 H5 { font-size: 12pt }
309 H6 { font-size: 11pt }
311 P, OL, UL, DL, BLOCKQUOTE, PRE {
321 OL, UL, DD { margin-left: 2em }
323 TT, KBD, PRE { font-family: Courier }
325 PRE { font-size: 9pt }
334 margin-bottom: 0.5em;
342 DIV.noprint { display: none }
344 DEL { text-decoration: line-through }
346 A:link, HR { color: black }
357 eval "require POSIX";
360 %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1);
361 %fal=("serif","times", "sans_serif","helvetica", "monospace","courier");
362 @fo=("p","pre","h1","h2","h3","h4","h5","h6","i","b","tt","kbd","cite","samp",
363 "address","blockquote","ol","ul","dl","dt","dd","table","header","footer");
365 %valid=('font',1, 'font_files',1, 'margin,left',1, 'margin,right',1,
366 'margin,top',1, 'margin,bottom',1);
367 %cm=('cm',1, 'mm',0.1, 'in',2.54, 'pt',2.54/72, 'pc',2.54/6);
368 %pt=('cm',72/2.54, 'mm',72/25.4, 'in',72, 'pt',1, 'pc',12);
369 %space=('thinsp',6, '#8201',6, 'ensp',2, '#8194',2, 'emsp',1, '#8195',1);
370 $space=join('|',keys %space);
371 %vars=("T","Ti", "N","Pn", "U","UR", "H","h", "A","Au");
372 %height=("letter",27.9, "legal",35.6, "arche",121.9, "archd",91.4, "archc",61,
373 "archb",45.7, "archa",30.5, "flsa",33, "flse",33, "halfletter",21.6,
374 "11x17",43.2, "ledger",27.9);
375 %width=("letter",21.6, "legal",21.6, "arche",91.4, "archd",61, "archc",45.7,
376 "archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14,
377 "11x17",27.9, "ledger",43.2);
379 $version="html2ps version 1.0 beta3";
380 $opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|k:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|t|T|u|"
382 %optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d',
383 'DSC','D', 'encoding','e', 'rcfile','f', 'frame','F', 'grayscale','g',
384 'help','h', 'hyphenate','H', 'scaleimage','i', 'cookie','k', 'language','l',
385 'landscape','L', 'scalemath','m', 'number','n', 'startno','N', 'output','o',
386 'original','O', 'rootdir','r', 'xref','R', 'scaledoc','s', 'style','S',
387 'titlepage','t', 'text','T', 'underline','u', 'colour','U', 'version','v',
388 'web','W', 'duplex','x');
389 %type=( 'paper,height',2, 'paper,width',2, 'option,i',3, 'option,m',3,
390 'option,N',4, 'option,s',3, 'option,x',4, 'xref,passes',4, 'draft,print',5);
394 html2ps [-2cdDFghHLnORtTuUv] [-b URL] [-C string] [-e encoding]
395 [-f file[:file[:...]]] [-i num] [-k file] [-l lang] [-m num] [-N num]
396 [-o file] [-r path] [-s num] [-S string] [-W string] [-x num]
397 [file|URL [file|URL [...]]]
401 $usage.="The html2ps users guide is available as $ug\n\n" if(-r $ug);
404 &Getopts($opts) || die $usage;
407 open(DBG,">html2ps.dbg") || die "Error opening debug file: html2ps.dbg\n";
408 print STDERR "***** Writing debug info to html2ps.dbg\n";
409 print DBG "***** $version\n***** Command: $0 $args\n***** Perl: $]\n";
410 print DBG "***** HTML2PSPATH=$ENV{'HTML2PSPATH'}\n";
414 $V='(-?\d+\.?\d*|-?\d*\.?\d+)';
419 eval "\$deffnt{'$_'}=defined \$$_\{'font-family'\}?"
420 ."\$$_\{'font-family'\}:\$body{'font-family'}";
423 if(open(RC,$globrc)) {
425 print DBG "***** Global file $globrc:\n$conf" if($opt_d);
429 &dbg("Warning: cannot open the global resource file: $globrc\n") if($globrc);
431 $html2psrc=~s/^(~|\$HOME)/$ENV{"HOME"}/;
434 ($prc=$opt_f)=~s/^:/$html2psrc:/;
435 $prc=~s/:$/:$html2psrc/;
436 $prc=~s/::/:$html2psrc:/;
438 $cwd=$posix?POSIX::getcwd():"";
442 $globrc=~/html2psrc/;
444 $hpath=$ENV{"HTML2PSPATH"}?$ENV{"HTML2PSPATH"}:".:";
445 $hpath=~s/^:/$gdir:/;
446 $hpath=~s/:$/:$gdir/;
447 $hpath=~s/::/:$gdir:/;
448 $cur=$hpath=~s/(^|:)\.($|:)/$1$cwd$2/;
449 @hpath=split(/:/,$hpath);
451 if(opendir(DIR,$_)) {
453 $files{$_}=" @files ";
460 S:for $dir (@hpath) {
461 if(-r $rc && !grep(/^$rc$/,@local) || $files{$dir}=~/ $rc /) {
462 chdir $dir if($files{$dir}=~/ $rc / && $cwd);
465 print DBG "***** Personal file $rc:\n$conf" if($opt_d);
473 &dbg("Error opening resource file: $rc\n") if($opt_f && !$found);
477 &getconf($opt_S) if($opt_S);
478 print DBG "*****\n" if($opt_d);
480 ($pagew,$pageh)=split /\s+/, $AT_page{'size'} if(defined $AT_page{'size'});
482 require Image::Magick if($package{'PerlMagick'});
483 $geturl=$package{'geturl'};
486 $giftopm="giftopnm" if($package{'netpbm'});
487 $giftopm="giftoppm" if($package{'pbmplus'});
489 for(keys %option){eval "\$opt_$_='$option{$_}' if(!defined \$opt_$_)"};
490 die $usage if $opt_h;
491 die "$version\n" if $opt_v;
492 &dbg("$version\n") if ($opt_v||$opt_d);
493 die "Ghostscript is required to generate DSC PostScript\n"
494 if($opt_D && !$package{'Ghostscript'});
495 die "Ghostscript is required to generate cross references\n"
496 if($opt_R && !$package{'Ghostscript'});
497 $tmpname=$posix?POSIX::tmpnam():"h2p_$$";
498 ($scr=$tmpname)=~/\w+$/;
501 if($opt_u) {$ulanch="t"};
502 if(defined $opt_x && $opt_x!~/^[0-2]$/) {
503 die "Illegal duplex value: $opt_x\n";
505 $V='(-?\d+\.?\d*|-?\d*\.?\d+)';
506 for $o ($opt_s,$opt_i,$opt_m,$opt_N) {
507 die "Non numeric: $o\n" if(defined($o) && $o!~/^$V$/);
510 $twoup=$opt_2?"t":"f";
511 $xp=$extrapage?"t":"f";
513 die "Invalid option: -W $opt_W\n" if($opt_W!~/^[abflprsL\d]*$/);
514 $tocdoc=$opt_C=~/[ft]/;
515 if($tocdoc && !defined $opt_W) {$opt_W=4};
516 $mult=$#ARGV>0 || $opt_W;
517 $maxlev=$opt_W=~/(\d+)/?$1:4;
525 if($opt_C && $opt_C!~/^(b?[ft]|[ft]b?|b?h|hb?)$/)
526 {die "Invalid option: -C $opt_C\n"};
529 $first=$opt_C=~/b/ || $opt_R;
536 POSIX::setlocale(&POSIX::LC_TIME,$locale) if($posix);
537 $R='(\s*>|[^a-zA-Z0-9>][^>]*>)';
538 $S='([\w.:/%-]+)|"([^"]*)"|\'([^\']*)\'';
540 $IM='(gif|jpeg|jpg|png|xbm|xpm|ps|eps)';
542 for('odd-left','odd-center','odd-right','even-left','even-center','even-right')
544 $oeh=1 if defined $header{$_};
545 $oef=1 if defined $footer{$_};
548 for $a ('left','center','right') {
549 if(defined $header{"odd-$a"} || defined $header{"even-$a"}) {
552 if(defined $footer{"odd-$a"} || defined $footer{"even-$a"}) {
555 for('','odd-','even-') {
557 $numb=1 if($apa=~/(^|[^\$])\$N/);
558 &spec($header{$_.$a});
559 &spec($footer{$_.$a});
560 $header{$_.$a}="($apa)";
562 $numb=1 if($apa=~/(^|[^\$])\$N/);
563 $footer{$_.$a}="($apa)";
564 &varsub($header{$_.$a},$footer{$_.$a});
568 $yz="/YY [[{$header{'odd-left'}}{$header{'even-left'}}]"
569 ."[{$header{'odd-right'}}{$header{'even-right'}}]"
570 ."[{$header{'odd-center'}}{$header{'even-center'}}]] D\n";
572 $ind=$header{'alternate'};
573 $yz="/YY [[{$header{'left'}}$ind][{$header{'right'}}".(1-$ind)
574 ."][{$header{'center'}}2]] D\n";
577 $yz.="/ZZ [[{$footer{'odd-left'}}{$footer{'even-left'}}]"
578 ."[{$footer{'odd-right'}}{$footer{'even-right'}}]"
579 ."[{$footer{'odd-center'}}{$footer{'even-center'}}]] D";
581 $ind=$footer{'alternate'};
582 $yz.="/ZZ [[{$footer{'left'}}$ind][{$footer{'right'}}".(1-$ind)
583 ."][{$footer{'center'}}2]] D";
585 $number=$opt_n || !$numb && ($opt_C || $opt_N || $opt_R)?"t":"f";
586 $tih=$titlepage{'content'};
587 $toch=$toc{'heading'};
588 for ($imgalt,$xref{'text'},$tih,$toch,$inh,$draft{'text'}) {
592 for ($paper{'height'},$paper{'width'},$margin{'middle'},$frame{'margin'},
593 $mlr,$mrl,$mtl,$mbl,$mll,$mrr,$mtr,$mbr,$pagew,$pageh) {
596 $opt_s*=0.65 if($opt_2 && $opt_L);
597 $opt_N=1 if(!defined $opt_N);
598 $opt_N=int($opt_N-1);
599 $mm=int($margin{'middle'}*$f);
602 $mag=1200*$opt_m*$opt_s;
603 $xref=$opt_R?"t":"f";
604 $xref{'text'}=~s/\$N/) WB pN WB (/g;
606 $d=int($f*$frame{'margin'});
609 $width{"a$_"}=int($temp*2**(-1/4)*1000+.5)/10;
610 $height{"a$_"}=int($temp*2**(1/4)*1000+.5)/10;
611 $width{"b$_"}=int($temp*1000+.5)/10;
612 $height{"b$_"}=int($temp*2**(1/2)*1000+.5)/10;
614 if(!$pagew || !$pageh) {
615 if($width{"\L$paper{'type'}"}) {
616 $paper{'width'}=$width{"\L$paper{'type'}"} if(!defined $paper{'width'});
617 $paper{'height'}=$height{"\L$paper{'type'}"} if(!defined $paper{'height'});
618 ($pagew,$pageh)=($paper{'width'},$paper{'height'});
619 } elsif($paper{'type'}) {
620 &dbg("Unknown paper type: $paper{'type'}\n");
624 $wl=$pageh-$mll-$mrl;
625 $wr=$pageh-$mlr-$mrr;
626 $hl=int(($pagew-$mtl-$mbl)*$f+.5);
627 $hr=int(($pagew-$mtr-$mbr)*$f+.5);
634 $wl=$pagew-$mll-$mrl;
635 $wr=$pagew-$mlr-$mrr;
636 $hl=int(($pageh-$mtl-$mbl)*$f+.5);
637 $hr=int(($pageh-$mtr-$mbr)*$f+.5);
640 $yl=int(($pageh-$mtl)*$f+.5);
641 $yr=int(($pageh-$mtr)*$f+.5);
646 $wl=($wl-$margin{'middle'})/2;
647 $wr=($wr-$margin{'middle'})/2;
651 $pag=int($pageh*$f+.5);
655 $rm=$numbstyle?"t":"f";
656 $pa=$showurl?"t":"f";
657 $nh=$seq_number?"t":"f";
658 $bt=$break_table?"t":"f";
659 $ea=$expand_acronyms?"t":"f";
660 $fi=$prefilled?"t":"f";
661 $latin1=$opt_e=~/ISO-8859-1/i;
662 $lt=$del{'text-decoration'}=~/^line-through$/i?"SE":"WB";
663 if(!$opt_x && defined $opt_x) {
664 $dupl="[{false statusdict/setduplexmode get exec} stopped cleartomark";
667 $dupl="[{true statusdict/setduplexmode get exec} stopped cleartomark";
670 $dupl.="\n[{true statusdict/settumble get exec} stopped cleartomark";
673 %head=("html",1, "head",1, "title",1, "base",1, "meta",1, "link",1, "style",1,
674 "script",1, "isindex",1);
675 %algn=("left",1, "center",2, "right",3, "justify",4, "char",5);
676 %f=("void",1, "above",2, "below",3, "hsides",4, "lhs",5, "rhs",6, "vsides",7,
677 "box",8, "border",9);
678 %r=("none",1, "groups",2, "rows",3, "cols",4, "all",5);
679 %v=("top",1, "middle",2, "bottom",3, "baseline",4);
680 %it=("radio",0, "checkbox",1, "text",2, "password",2, "image",3);
681 %ssy=(200,"\\", 201, "(", 202, ")");
682 %lity=("I",0, "i",1, "A",2, "a",3, "1",4, "disc",5, "square",6, "circle",7);
683 $ltr=join('|',keys %lity);
684 %tex=('`a',"\340", '\^a',"\342", '`e',"\350", '`e',"\350", 'c\{c\}',"\347",
685 "'e","\351", '\^e',"\352", '"e',"\353", '\^i',"\356", '"i',"\357",
686 '\^o',"\364", '`u',"\371", '\^u',"\373", '"u',"\374", '"y',"\377",
687 'aa',"\345", '"a',"\344", '"o',"\366", 'ae',"\346", 'oe',"\225");
689 $ltrs='A-Za-z\222-\226\300-\377';
888 "forall|#8704","042",
911 "lowast|#8727","052",
950 ($toct=$toch)=~s|<[\w/!?][^>]*>||g;
951 $dh="/h0 [()($toct)] D\n";
953 $toch=~s/ H\(/ -1 H(/g;
957 $tih=~s/ H\(/ -1 H(/g;
963 for (@fo) {&setel($_)};
967 if(!$latin1 && !defined $fontid{"times"}) {
968 $fontid{"times"}=$nfont++;
969 @docfonts=(@docfonts,split(/\s+/,$font_names{"times"}));
974 $wind=$fontid{"times"};
978 for $k (keys %font_files){
979 @ff=split(/\s+/,$font_files{$k});
980 @fn=split(/\s+/,$font_names{$k});
983 $ff{$fn[$_]}=$ff[$_];
984 } elsif(!$ff{$fn[$_]}) {
990 $pta=defined $p{"text-align"}?$p{"text-align"}:$body{"text-align"};
992 $pal=1 if($pta=~/^c/i);
993 $pal=2 if($pta=~/^r/i);
994 $pal=3 if($pta=~/^j/i);
995 $bgcol=&col2rgb($body{"background"});
996 if(!$bgcol) {$bgcol="[16#FF 16#FF 16#FF]"};
997 if(!$p{"color"}) {$p{"color"}="black"};
998 $tcol=&col2rgb($p{"color"});
999 $lcol=&col2rgb($a__link{"color"});
1001 $Lc="/Lc t D\n/Dl $lcol D\n";
1002 $Lc.=$tcol ne $lcol?"/LX t D":"/LX f D";
1004 $Lc="/Lc f D\n/LX f D";
1006 $pcol=&col2rgb($pre{"color"});
1007 if(!$pcol) {$pcol="[0 0 0]"};
1008 $deftbg=&col2rgb($table{"background"});
1009 $hc=&col2rgb($hr{"color"});
1010 if(!$hc) {$hc="[0 0 0]"};
1011 $fcol=&col2rgb($frame{"color"});
1012 if(!$fcol) {$fcol="[0 0 0]"};
1013 for ($p{"font-size"},$pre{"font-size"},$header{"font-size"},$frame{'width'},
1014 $footer{"font-size"},$justify{'letter'},$justify{'word'},
1015 $titlepage{'margin-top'}) {
1018 for ($p{"line-height"},$p{"text-indent"},$p{"margin-top"},$toc{'indent'},
1022 $fl="/FL [/".join("\n/",@docfonts)."] D";
1025 if(defined $fontid{$fr{$k}} && !defined($cont{$f})) {
1026 open(FONT,$f) || &dbg("Error opening fontfile $f\n");
1027 ($cont{$f}=<FONT>)=~s/(^|\r?\n|\r)%.*//g;
1033 $fontdef.=$cont{$_};
1036 &ent($xref{'text'});
1037 &ent($draft{'text'});
1040 for (keys %quote_open) {
1042 if(!defined $quote_close{$_}) {$quote_close{$_}=$quote_open{$_}};
1043 if(!defined $quote_open2{$_}) {$quote_open2{$_}=$quote_open{$_}};
1044 if(!defined $quote_close2{$_}) {$quote_close2{$_}=$quote_close{$_}};
1045 &ent($quote_open{$_});
1046 &ent($quote_close{$_});
1047 &ent($quote_open2{$_});
1048 &ent($quote_close2{$_});
1049 push(@qo,$quote_open{$_});
1050 push(@qc,$quote_close{$_});
1051 push(@qo2,$quote_open2{$_});
1052 push(@qc2,$quote_close2{$_});
1056 $qo2=join(')(',@qo2);
1057 $qc2=join(')(',@qc2);
1058 $hyphenation_file{''}=$hyphenation_file{'en'};
1059 $br=$collapse_br?"f":"t";
1061 $ddr=defined $draft{'print'};
1063 if($draft{'print'}==0) {
1070 if(-e '/dev/null' || !-e 'nul') {
1077 $gb=$gs_bug?"t":"f";
1078 for (keys %quote) {$lid{$_}=$lid{$quote{$_}}};
1079 $ENV{'PATH'}.="$pathsep$package{'path'}" if($package{'path'});
1080 $delim="%-- End of variable part --";
1081 $cd="/Cd {aload length 2 idiv dup dict begin {D} repeat currentdict end} D";
1084 /MySymbol 10 dict dup begin
1085 /FontType 3 D /FontMatrix [.001 0 0 .001 0 0 ] D /FontBBox [25 -10 600 600] D
1086 /Encoding 256 array D 0 1 255{Encoding exch /.notdef put}for
1087 Encoding (e) 0 get /euro put
1088 /Metrics 2 dict D Metrics begin
1092 /BBox 2 dict D BBox begin
1093 /.notdef [0 0 0 0] D
1094 /euro [25 -10 600 600] D
1096 /CharacterDefs 2 dict D CharacterDefs begin
1098 /euro{newpath 114 600 moveto 631 600 lineto 464 200 lineto 573 200 lineto
1099 573 0 lineto -94 0 lineto 31 300 lineto -10 300 lineto closepath clip
1100 50 setlinewidth newpath 656 300 moveto 381 300 275 0 360 arc stroke
1101 -19 350 moveto 600 0 rlineto -19 250 moveto 600 0 rlineto stroke}d
1104 /char E D /fontdict E D /charname fontdict /Encoding get char get D
1106 Metrics charname get 0 BBox charname get aload pop setcachedevice
1107 CharacterDefs charname get exec
1110 /BuildChar load 0 3 dict put /UniqueID 1 D
1120 /d {bind def} bind def
1150 /TI $toc{'indent'} Ts mul D
1160 /FE {newpath Fm neg Fm M CP BB IW Fm add Fm L IW Fm add IL Fm add neg L CP BB
1161 Fm neg IL Fm add neg L closepath} D
1162 /LA {PM 0 eq{/IW Wl D /IL hL D}{/IW Wr D /IL hR D}ie /W IW D /LL W D /LS W D
1163 /LE IL D TU PM 0 eq and{IW $mm F div add SA{Sf div}if 0 translate}
1164 {PM 0 eq{xL yL}{xR yR}ie translate$rot F SA{Sf mul}if dup scale
1165 CS CF FS Cf{CA CL get VC}if /Bb f D}ie 0 0 M
1166 TF not Tc or {Cf{gsave SA{1 Sf div dup scale}if Cb VC FE fill grestore}if}if}D
1167 /Pi $p{"text-indent"} Ts mul D
1168 /SG [$is $opt_i $msc] D
1169 /Ab $justify{'word'} D
1170 /J $justify{'letter'} D
1175 /LH $p{"line-height"} D
1177 /Xr {/pN E D ( $xref{'text'} )WB} D
1186 /DS {/PF f D($doc_sep)pop RC ZF} D
1192 /DX ($draft{'text'}) D
1194 /Tt $titlepage{'margin-top'} D
1197 /FD $fontid{"\L$font"} D
1200 /FW $frame{'width'} D
1202 /ET {/RM $rm D /A0 $pal D /PN SN D /OU t D /Ou t D /W IW D /LL W D D1
1203 Ms not TP and{Ip}if /TF f D} D
1210 WF{FL{reencodeISO D}forall}{4 1 FL length 1 sub{FL E get reencodeISO D}for}ie
1211 /Symbol dup dup findfont dup length dict begin
1212 {1 index /FID ne{D}{pop pop}ie}forall /Encoding [Encoding aload pop]
1213 dup 128 /therefore put D currentdict end definefont D
1217 dup dup findfont dup length dict begin{1 index /FID ne{D}{pop pop}ie}forall
1218 /Encoding ISOLatin1Encoding D currentdict end definefont} D
1219 /ISOLatin1Encoding [
1220 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1221 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1222 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1223 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1224 /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright
1225 /parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
1226 /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon
1227 /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N
1228 /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright
1229 /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m
1230 /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde
1231 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1232 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1233 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1234 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
1235 /.notdef/space/exclamdown/cent/sterling/currency/yen/brokenbar
1236 /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot
1237 /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior
1238 /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine
1239 /guillemotright/onequarter/onehalf/threequarters/questiondown
1240 /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
1241 /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
1242 /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
1243 /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute
1244 /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis
1245 /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave
1246 /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex
1247 /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis
1248 /yacute/thorn/ydieresis
1250 [128/backslash 129/parenleft 130/parenright 141/circumflex 142/tilde
1251 143/perthousand 144/dagger 145/daggerdbl 146/Ydieresis 147/scaron 148/Scaron
1252 149/oe 150/OE 151/guilsinglleft 152/guilsinglright 153/quotesinglbase
1253 154/quotedblbase 155/quotedblleft 156/quotedblright 157/endash 158/emdash
1255 aload length 2 idiv 1 1 3 -1 roll{pop ISOLatin1Encoding 3 1 roll put}for
1256 /colorimage where{pop}{
1258 pop pop /Pr E D {/Cv Pr D /Gr Cv length 3 idiv string D 0 1 Gr length 1 sub
1259 {Gr E dup /i E 3 mul D Cv i get 0.299 mul Cv i 1 add get 0.587 mul add
1260 Cv i 2 add get 0.114 mul add cvi put}for Gr} image} D
1262 /pdfmark where{pop}{userdict /pdfmark /cleartomark load put}ie
1276 /CP {currentpoint} d
1281 /LW {setlinewidth} d
1282 /S {dup () ne OU and{0 Co R AT 3 eq LB and HF not and A1 0 ne A2 0 ne or and
1283 {A2 0 32 A1 0 6 -1 roll awidthshow}{show}ie 0 Co neg R}{pop}ie
1284 OU PH 3 eq or{/Ms t D}if} D
1285 /U {OU{gsave CP currentfont /FontInfo get /UnderlinePosition get
1286 0 E currentfont /FontMatrix get dtransform E pop add newpath M dup SW pop
1287 CJ 0 RL stroke grestore}if} D
1288 /B {OU Br 0 gt and{CP Ts neg Ts .33 mul R gsave 0 Sg
1289 CP newpath Ts Br mul 0 360 arc closepath UI 2 mod 0 eq{stroke}{fill}ie
1290 grestore M CP E Ts Br 1 add mul sub E BB /Ms t D}if}D
1291 /NP {Ms TP not or PA and OU and{TP{OR}if f1{mF k2 /mF E D /YC 0 D}if
1292 TP TU not PM 0 eq or and{showpage}if DU Ip TE not{LA}if 0.6 LW
1293 /CI 0 D /TP t D /Hs f D /hl 6 D /Hv 6 D /HI hi D /Ms f D}if Bs XO BO M} D
1294 /Np {LE sub CP E pop gt PL 0 eq and{NP}if}D
1295 /Ip {/PN PN 1 add D /Pn RM{1}{4}ie PN Ns D /PM PN SN sub 2 mod D} D
1296 /GP {E dup 3 -1 roll get PN 1 add 2 mod get dup type /integertype eq
1297 {get 0 get}{E pop}ie}d
1298 /Fc {dup 2 GP exec SW pop /S1 E D dup 1 GP exec SW pop /S2 E D 0 GP exec SW
1299 pop /S3 E D S1 0 gt{S2 2 mul S1 add S3 2 mul S1 add 2 copy lt{E}if pop}{0}ie
1300 S2 S3 add 2 copy lt{E}if pop IW .9 mul div dup 1 gt{1 E div}{pop 1}ie}D
1301 /OR {Df{Sd}if tp not{gsave SA{1 Sf div dup scale}if Fe{Cf{FU VC}if FW LW
1302 1 setlinejoin FE stroke}if /YO {60 F div dup 40 gt{pop 40}if}D /cs CS D
1303 /cf CF D /CF 0 D /pf PF D /PF f D /Fn FN D /At AT D /AT 0 D /FN EF Hf 1 add
1304 get D Fz Fs FS ZZ Fc Fz mul Fs FS EU Hf 1 add get dup type /arraytype eq
1305 Cf and{VC}{pop 0 Sg}ie IW IL neg YO sub M ZZ 1 GP exec dup SW pop neg 0 R Sh
1306 0 IL neg YO sub M ZZ 0 GP exec Sh ZZ 2 GP exec dup SW pop IW E sub 2 div
1307 IL neg YO sub M Sh Fz Fs FS NO{/AW IW Pn SW pop sub D AW 2 div IL neg YO sub
1308 S1 0 gt S2 AW .45 mul gt or S3 AW .45 mul gt or{Fz 2 mul sub}if M Pn Sh}if
1309 EU Hf get dup type /arraytype eq Cf and{VC}{pop 0 Sg}ie YY Fc /FN EF Hf get D
1310 Hz mul HS FS IW YO M YY 1 GP exec dup SW pop neg 0 R Sh 0 YO M YY 0 GP exec Sh
1311 YY 2 GP exec dup SW pop IW E sub 2 div YO M Sh /FN Fn D /AT At D t Pb XO SZ
1312 SL get neg R /PF pf D grestore /CF 0 D cs cf FS}if}D
1313 /Sh {dup () ne{CP Hz 4 div sub BB show CP CS add BB}{pop}ie}D
1314 /Pb {/OU E D /Ou OU D /PB t D 0 0 M Ba{/Sa save D /BP t D /Fl t D RC /PL 0 D
1315 /PH 0 D /W IW D /LE IL .7 mul D /EO 0 D SI ZF /YA 0 D /BO 0 D /C1 () D
1316 BA 0 Ts neg R Bb{Xl Yl Xh Yh}if Bb CP Sa restore M
1317 {/Yh E D /Xh E D /Yl E D /Xl E D}if /Fl t D}if
1318 BL /OU t D /HM f D /Ou t D /PB f D} D
1321 /SF {/CS E D SZ SL CS put FO SL FN put /YI CS LH neg mul D dup ST cvs ( ) join
1322 CS ST cvs join C1 E join ( NF ) join /C1 E D CS NF /Wf WF FN 0 gt or D
1323 /BW Wf{( ) SW pop}{0}ie D}D
1324 /NF {/cS E D /cF E D cF 0 ge{FL cF get}{cF -1 eq{/Symbol}{/MySymbol}ie}ie
1325 findfont cS scalefont setfont} D
1326 /FS {CF or /CF E D FR SL CF put CF CF 0 ge{FN 4 mul add}if E SF} D
1327 /PC {SH /BP f D fin not GL not and{NL}if /HM t D /LL LS D} D
1328 /BS {/TX E D Wf{/fin f D /CW 0 D /LK 0 D /SC 0 D
1329 /RT TX D {RT ( ) search{/NW E D pop /RT E D /WH NW SW pop D CW WH add LL gt
1330 {TX SC LK SC sub 1 sub NN GI GL{SH cF cS OC
1331 2 copy cS ne E cF ne or{NF}{pop pop}ie}{PC /CW WH BW add D}ie
1334 /CW CW WH add BW add D /HM t D}ie /GL f D /Ph f D
1335 /LK LK NW length 1 add add D}{pop exit}ie}loop
1336 /fin t D TX SC LK SC sub GI SH RT () ne{GL not{CC}if}if
1337 /LC TX length D /WH RT SW pop D CW WH add Hy{HC SW pop add}if LL gt
1338 {RT GL{SH cF cS OC 2 copy cS ne E cF ne or{NF}{pop pop}ie
1339 Hy{/Ph t D}if /LL LS D}{NL /LL LS D SH}ie}
1340 {RT PC Hy{CC}if /Ph Ph Hy or D}ie RT () ne{/GL t D /HM t D}if}
1341 {TX SW pop LL le{TX SH}{/NW () D 0 2 TX length 1 sub
1342 {/CW E D TX 0 CW GI dup SW pop LL gt{pop NW SH /HM t D NL/LL W XO sub MR sub D
1343 /CW CW 2 sub NN D /TX TX CW TX length CW sub GI D TX BS exit}
1344 {/NW E D}ie}for}ie}ie /HM t D}D
1345 /CC {C0 length 0 gt{JC}if /C0 [C1 L1 YA YB Mf NS NB TB AF Bw] D
1346 /C1 () D /L0 L1 D /YA 0 D /YB 0 D /Mf 0 D /NS 0 D /NB 0 D}D
1347 /JC {C0 aload length 0 gt{pop pop pop NB add /NB E D NS add /NS E D
1348 dup Mf gt{/Mf E D}{pop}ie dup YB gt{/YB E D}{pop}ie
1349 dup YA gt{/YA E D}{pop}ie pop C1 join /C1 E D /C0 [] D}if}D
1350 /OC {C0 length 0 gt{C1 L1 L0 sub YA YB Mf NS NB TB AF Bw GL C0 aload pop
1351 /Bw E D /AF E D /TB E D /NB E D /NS E D /Mf E D /YB E D /YA E D /C0 [] D
1352 /L1 E D /C1 E D Ph{HC SH}if NL /GL E D /Bw E D /AF E D /TB E D /NB E D /NS E D
1353 /Mf E D /YB E D /YA E D /L1 E D /LL W L1 sub XO sub MR sub WH sub D /CW 0 D
1354 C1 E join /C1 E D}if}D
1355 /BT {/LB t D dup length string copy RS dup dup () ne E ( ) ne and
1356 {/CI 0 D /LS LL D /LL W L1 sub XO sub MR sub D BS}
1357 {dup ( ) eq{/GL f D}if dup () eq L1 0 eq or{pop}{SH /BP f D /Ph f D}ie}ie
1359 /BL {CP E pop XO E M} D
1360 /NL {JC /GL f D /SK W XO sub MR sub L1 sub TB{Bw add}if D
1361 /YA LF{Mf HM Fl not and PF or{LH mul}if}{0 /LF t D}ie YA 2 copy lt{E}if pop D
1362 C1 () ne{/FB YB Mf SA{Sf mul}if 4 div 2 copy lt{E}if pop D}if Fl{/Ya YA D}if
1363 CP E pop YA sub YB sub LE neg lt Fl not and PB not and{NP}if NT TL BL
1364 OU PF not and PB or{/RE L1 TB{Bw sub}if
1365 W XO sub MR sub div YA YB add LE BO add div 2 copy lt{E}if pop D
1366 RE 1 gt{BL 1 RE div dup scale}if}if
1367 AT 2 le{SK AT mul 2 div YA neg R}if
1368 AT 3 eq{0 YA neg R TB{/NB NB 1 sub D /NS NS 1 sub D}if /NB NB 1 sub NN D
1369 /A3 NS 6 mul NB add D NS NB add 0 eq
1371 {NS 0 eq{/A1 SK NB div dup J gt{pop 0}if D /A2 0 D}{J A3 mul SK lt
1372 {/A1 J D /A2 SK J NB mul sub NS div dup Ab gt{/A1 0 D pop 0}if D}
1373 {/A1 SK A3 div D /A2 A1 6 mul D}ie}ie}ie /A1 A1 NN D /A2 A2 NN D}if
1374 AT 4 eq{0 YA neg R PH 2 le{PD 0 lt{/PD L1 D}if PD M1 gt{/M1 PD D}if
1375 L1 PD sub M2 gt{/M2 L1 PD sub D}if}{DV ID 1 sub get 0 ge{Lo 0 R}if}ie}if
1376 F0 cF ne Cs cS ne or{F0 Cs NF}if
1377 /ms Ms D /Ms f D CP FB sub
1378 C1 cvx exec XO EO sub L1 add TB{BW sub}if dup LM gt{/LM E D}{pop}ie
1379 PH 0 eq PH 4 eq or Ms and{HF not{/PO t D /AH t D}if
1380 BB CP YA add E AT 3 eq LB and{A1 sub}if TB{BW sub}if E BB}
1381 {pop pop}ie Ms HM PH 3 eq and or{/BP f D /Fl f D}if
1382 /Lo 0 D /L1 0 D /F0 cF D /Cs cS D BP not{0 YB NN neg R}if
1383 OU f1 and mF not and{k2 /f1 f D}if
1384 OU PF not and PB or{RE 1 gt{RE dup scale}if}if /Ms ms Ms or D
1385 /C1 AF{(Cp )}{()}ie D /YA 0 D /YB 0 D BL
1386 AT 4 eq LB not and PH 3 ge and
1387 {ID DV length lt{DV ID get dup 0 ge{DO E sub /Lo E D /L1 Lo D}{pop}ie
1388 /ID ID 1 add D}if}if /T t D CD{/LN LN 1 add D PD}if
1389 /PD -1 D /NS 0 D /NB 0 D /TB f D /Ph f D /Mf 0 D /HM f D} D
1390 /RS {/TM E D /CN 0 D TM{10 eq{TM CN ( ) PI}if /CN CN 1 add D}forall
1391 /CN 0 D /BK HM EN and{0}{1}ie D TM
1392 {dup 32 ne{TM CN 3 2 roll put /CN CN 1 add D /BK 0 D}
1393 {pop BK 0 eq{TM CN 32 put /CN CN 1 add D}if /BK 1 D}ie}forall
1394 TM 0 CN GI dup dup () ne E ( ) ne and
1395 {dup CN 1 sub get 32 eq{/EN f D}{/EN t D}ie}if} D
1396 /join {2 copy length E length add string dup 4 2 roll 2 index 0 3 index
1398 /WR {(\\n) search{dup () ne BP not or
1399 {Li 4 le CP E pop YI Li mul add LE add 0 lt and PL 0 eq and{NP}if
1400 SH NL pop /Li Li 1 sub D WR}{pop pop WR}ie}{SH}ie /CI 0 D /BP f D} D
1401 /SH {dup dup () ne E ( ) ne and PF or CS Mf gt and{/Mf CS D}if
1402 T not Wf and{( ) E join /T t D}if dup BP{/MF CS D}if
1403 AT 3 eq{2 copy length dup 0 gt{/NB E NB add D
1404 {( ) search{/NS NS 1 add D pop pop}{pop exit}ie}loop}{pop pop}ie}if
1405 CD PD 0 lt and{dup DC search{SW pop /PD E L1 add D pop pop}{pop}ie}if
1406 0 Np dup SW pop L1 add /L1 E D dup () ne
1407 {C1 (\\() join E join (\\)) join AU AF and UF or Wf and{( U ) join}if
1408 sF{( s ) join}if ( S ) join
1409 /C1 E D dup length 1 sub get 32 eq /TB E D /Bw BW D}{pop pop}ie} D
1410 /BG {AI LG BC add add 0 eq} D
1411 /ON {OU{Ty AR AI NN get dup 1 add Ln Ns Ty 2 mod 0 eq{(. )}{(\\) )}ie join
1412 dup SW pop neg 0 R CP E 0 lt{0 E M}{pop}ie CP BB show /Ms t D}if} D
1413 /Ln {AR AI 3 -1 roll put}D
1414 /SP {dup CI lt BP not and{dup CI sub 0 E R /CI E D}{pop}ie} D
1415 /BN {PF{WR /HM f D}{BT NL}ie} D
1416 /NN {dup 0 lt{pop 0}if} D
1417 /h {(h) HI ST cvs join cvx exec dup 1 get E Nf{0 get E join}{pop}ie} D
1418 /H {/fn FN D /Hi E 1 add D 1 sub /HL E D /H2 HL 2 add D /GS EZ H2 get D
1419 E Tm H2 get GS mul BE dup 0 gt{1 sub}{pop EG H2 get dup 0 lt{pop AT}if}ie NA
1420 WW Np /SL SL 1 add D /FN EF H2 get D GS Ey H2 get FS
1421 EU H2 get Sc Hs not HL Hl lt and Hs HL hl lt and or Hi 0 eq or
1422 {/HI Hi D /Hs t D /hl HL D /Hv HL D}if HL Hl lt{/hi Hi D}if
1423 Nf HI 0 gt and{(h) Hi ST cvs join cvx exec 0 get WB}if
1424 /HF t D /AH f D /PO f D} D
1425 /EH {Bm H2 get GS mul BE OA /SL SL 1 sub NN D /CF 0 D /FN fn D
1426 SZ SL get FR SL get FS /HF f D /GS Ts D ()Ec} D
1427 /P {E PF{WR}{PO{EP}{BN}ie Ts 4 mul Np AE not{Tm 0 get Ts mul neg SP}if
1428 dup 0 ge AH and{Pi Pd}if}ie 1 sub dup 0 lt{pop AV AL get}if /AT E D /PO t D} D
1429 /EP {PF{WR}{BN Ts 4 mul Np}ie AE not{Bm 0 get Ts mul neg SP}if
1430 /AT AV AL get D /PO f D} D
1431 /BE {E PO{EP}{BN}ie Ts 4 mul Np neg SP} D
1432 /HR {/Aw W EO sub D /RW E dup 0 gt{Aw mul}{neg}ie dup Aw gt{pop Aw}if D /RZ E D
1433 E BN Ts neg SP 1 sub 2 div Aw RW sub mul EO add CP E pop M PF{0 Ps neg R}if
1434 0 Np OU{gsave RZ LW Cf{Hc VC}{0 Sg}ie CP BB RW 0 RL CP BB stroke grestore}if
1435 /CI 0 D /BP f D PF not{Ts neg SP}if /Ms t D} D
1436 /AD {I NL EG 14 get dup 0 lt{pop AT}if NA /AE t D Tm 14 get Ts mul neg SP
1437 Cf{EU 14 get dup -1 eq{pop CA CL get}if Sc}if} D
1438 /DA {BN ()ES OA /AE f D ()Ec Bm 14 get Ts mul neg SP} D
1439 /PR {/MW E D /Li E D Tm 1 get Ps mul BE 0 NA /FN Fp D /PF t D SI /SL SL 1 add D
1440 /CF 0 D Ps CS mul Ts div MW WC mul CS mul Ts div dup LL gt PL 0 eq and
1441 {LL div div}{pop}ie Ey 1 get FS CP E pop LE add YI neg div cvi dup Li lt
1442 AH and{4 lt YI Li mul 5 mul LE add 0 gt or PL 0 eq and{NP}if}{pop}ie
1443 EU 1 get Sc /GS Ps D}D
1444 /RP {WR NL () /PF f D SI /FN 0 D ES Bm 1 get Ps mul neg SP OA /GS Ts D} D
1445 /SI {/XO Lm 15 get BC NN mul Lm 16 get AI UI sub NN mul add
1446 Lm 17 get UI NN mul add Lm 20 get LG NN mul add Ts mul
1447 PF{Lm 1 get Ps mul add}if EO add D
1448 /MR Rm 15 get BC NN mul Rm 16 get AI UI sub NN mul add
1449 Rm 17 get UI NN mul add Rm 20 get LG NN mul add Ts mul
1450 PF{Rm 1 get Ps mul add}if D /LL W XO sub MR sub D} D
1451 /DT {/cC E D BN /LG LG 1 sub D SI /LG LG 1 add D WW 2 div Np BL} D
1452 /DD {WB Cc 0 eq cC 0 eq and L1 0 eq or Lm 20 get Ts mul L1 sub TB{BW add}if
1453 Ts 2 div lt or NL /LF E D SI BL /cC 0 D} D
1454 /DL {Dc LG Cc put /Cc E D BG{Tm 18 get Ts mul BE}{BN}ie /LG LG 1 add D BL} D
1455 /LD {BN LG 0 gt{/LG LG 1 sub D}if /Cc Dc LG get D SI
1456 BG{()Bm 18 get Ts mul BE}if BL} D
1457 /UL {BG{Tm 17 get Ts mul BE}{BN}ie NR AI NN 0 put /UI UI 1 add D
1458 /AI AI 1 add D SI BL} D
1459 /LU {BN /UI UI 1 sub D /AI AI 1 sub D SI BG{()Bm 17 get Ts mul BE}if BL} D
1460 /OL {E BG{Tm 16 get Ts mul BE}{BN}ie TR AI NN Ty put /Ty E D NR AI NN 1 put
1461 /AI AI 1 add D SI BL 1 Ln} D
1462 /LO {BN /AI AI 1 sub D /Ty TR AI get D SI BG{()Bm 16 get Ts mul BE}if BL} D
1463 /LI {E BN -1 SP /BP f D /CI 0 D 0 Np NR AI 1 sub NN get 1 eq
1464 {dup dup 0 gt E 4 le and{/Ty E D}{pop}ie
1465 /L1 L1 Ty AR AI NN get Ns SW pop XO sub dup 0 lt{pop 0}if add D ( ON )}
1466 {pop ( B )}ie C1 E join /C1 E D CS Mf gt{/Mf CS D}if BL} D
1467 /BQ {Tm 15 get Ts mul BE /BC BC 1 add D SI BL} D
1468 /QB {Bm 15 get Ts mul BE /BC BC 1 sub D SI BL} D
1469 /Al {E EP 1 sub dup 0 lt{pop AV AL get}if NA} D
1471 /WB {PF{WR}{BT}ie} D
1472 /F1 {WB /FN 0 D CS 0 FS} D
1473 /F2 {WB /FN WI D CS 0 FS} D
1474 /HY {/Hy t D WB /Hy f D} D
1476 /A {/LT E D LT 1 eq{/RN E D}if /Lh E D WB /C1 C1 ( Cp ) join D
1477 Lc AF not and{Cl Sc}if /AF t D} D
1478 /EA {Lc AF and{Ec}{WB}ie TL Pa AF and Lh 0 ne and
1479 {( \\() Lh join (\\)) join /AF f D WB}if /AF f D} D
1480 /TL {C1 ( Tl ) apa /C1 E D} d
1481 /apa {AF OU and Lh 0 ne LT 1 eq or and{LT 1 eq{RN ( /) E ST cvs join}
1482 {(\\() Lh join (\\)) join}ie E join join}{pop}ie} d
1483 /Cp {/Xc CP /Yc E D D} D
1484 /SS {Cf{dup 0 ge{EU E get dup -1 eq{pop CA CL get}if}{pop CA CL get}ie Sc}
1485 {pop}ie SZ SL get /SL SL 1 add D} D
1487 /EM {WB 8 SS /CF CF 1 xor D 0 FS} D
1488 /BD {WB 9 SS 2 FS} D
1489 /TT {WB 10 SS /FN Fp D 0 FS} D
1490 /KB {WB 11 SS /FN Fp D 2 FS} D
1491 /CT {WB 12 SS 1 FS} D
1492 /SM {WB 13 SS /FN Fp D 0 FS} D
1493 /Q {/QL QL 1 add D QO QL 2 mod get La get join WB} D
1494 /EQ {QC QL 2 mod get La get join WB /QL QL 1 sub D} D
1495 /RO {WB -1 SS /CF 0 D 0 FS} D
1496 /SY {WB -1 SS -1 FS} D
1497 /MY {WB -1 SS -2 FS} D
1498 /ES {WB /SL SL 1 sub NN D /CF 0 D /FN FO SL get D SZ SL get FR SL get FS ()Ec}D
1499 /FZ {3 sub 1.2 E exp GS mul E WB TL /C1 C1 ( Cp ) join D /SL SL 1 add D 0 FS} D
1500 /Ef {WB TL ()ES /C1 C1 ( Cp ) join D} D
1501 /BZ {dup /Bf E D FZ}D
1502 /Sc {dup -1 ne Cf and{/CL CL 1 add D dup 0 eq{pop [0 0 0]}if
1503 dup CA E CL E put VS ( VC ) join C1 E join /C1 E D}{pop}ie} D
1504 /Ec {WB Cf{/CL CL 1 sub NN D CA CL get VS ( VC ) join C1 E join /C1 E D}if} D
1505 /VS {dup type /arraytype eq{([) E {ST cvs join ( ) join}forall (]) join}if} D
1506 /VC {{255 div}forall setrgbcolor} D
1507 /Sl {dup type /integertype ne{Ds}if /La E D WB}d
1512 /sM {/C1 C1 ( k1 ) join D}d
1513 /eM {/C1 C1 ( k2 ) join D}d
1514 /k1 {/YC CP E pop Ts add D /mF t D /f1 t D}d
1515 /k2 {gsave 3 LW -9 CP E pop Ts 0.2 mul sub M -9 YC L stroke grestore /mF f D}d
1517 /Ca {eA{( \\()join AC join(\\) )join}if WB}d
1518 /s {OU{gsave 0 CS .25 mul R dup SW pop CJ 0 RL stroke grestore}if}D
1519 /CJ {AT 3 eq LB and{E dup dup length 1 sub A1 mul E
1520 {( ) search{pop pop E A2 add E}{pop exit}ie}loop 3 -1 roll add
1521 W CP pop sub 2 copy gt{E}if pop}if}D
1523 /SO {C1 Yo ST cvs join ( So ) join /C1 E D (j) SW pop 2 div Pd} D
1524 /Se {E WB CS E div Pd}D
1525 /Pd {dup type /stringtype eq{SW pop}if dup /L1 E L1 add D
1526 ST cvs ( 0 R ) join C1 E join /C1 E D} D
1529 /CO {OV Io Yo put /Yo E CS mul Yo add D /Io Io 1 add D -1.5 Io mul 3 add FZ SO
1530 CS Yo add dup YA gt{/YA E D}{pop}ie
1531 Yo neg dup YB gt{/YB E D}{pop}ie} D
1532 /Es {ES /Io Io 1 sub NN D /Yo OV Io get D SO} D
1533 /SB {/N2 0 D 0 1 NI{/N E D{IX N2 get 0 lt{/N2 N2 1 add D}{exit}ie}loop
1534 /K WS N get FC N get mul D /NY AY N2 get D /BV NY array D
1535 0 1 NY 1 sub{/TM K string D currentfile TM readhexstring pop pop BV E TM put}
1536 for BM N BV put /N2 N2 1 add D}for} D
1537 /IC [{/MA E D /MB 0 D}{2 div /MA E D /MB MA D}{/MB E CS sub D /MA CS D}
1538 {pop /MA YS AB mul D /MB 1 AB sub YS mul D}{pop /MA 0 D /MB 0 D}] D
1539 /IP {BV N get /N N 1 add D} D
1540 /II {/K E D IX K get 0 lt{/EC E D}if /TY E D
1541 TY 4 eq{/Y E D /X E D}if TY 3 eq{/AB E D}if
1542 /XW AX K get D /YW AY K get D /IS SG IT K get get D /XS XW IS mul D
1543 /YS YW IS mul D YS IC TY get exec /MA MA Fl not{3 add}if D} D
1544 /IM {II /ty TY D /xs XS D /ys YS D /ya YA D /yb YB D /ma MA D /mb MB D /k K D
1545 /ec EC D /BP f D /CI 0 D WB TL L1 xs add dup XO add MR add W gt
1546 {pop /ma ma Fl{3 add}if D NL /YA ma D /YB mb D /YS ys D /L1 xs D}
1547 {/L1 E D ma YA gt{/YA ma D}if mb YB gt{/YB mb D}if}ie /TB f D
1548 OU{CP E pop YS sub LE neg lt Fl not and PB not and{NP /YA ma D /YB mb D}if
1549 /BP f D ty ST cvs ( ) join IX k get 0 lt{(\\() join ec join (\\) ) join}if
1550 k ST cvs join ty 3 eq{AB ST cvs ( ) join E join}if
1551 ty 4 eq{X ST cvs ( ) join Y ST cvs join ( ) join E join}if C1 E join
1552 ( DI ) join FP 2 eq FP 1 eq AF and or{( FM ) join}if
1553 ( Il Cp ) apa /C1 E D /EN f D}if /HM t D /T f D} D
1554 /DI {II /Xc CP /Yc E D D /YN YW neg D /HM t D /CI 0 D /K2 IX K get D gsave
1555 TY 4 eq{OX X IS mul add OY FY add YS sub Y IS mul sub}
1556 {/FY YS D CP MB sub 2 copy /OY E D /OX E D}ie
1557 translate K2 0 ge{/DP AZ K2 get D /BV BM K2 get D XS YS scale /N 0 D XW YW DP
1558 [XW 0 0 YN 0 YW] {IP} FC K2 get 1 eq{image}{f 3 colorimage}ie}
1559 {EX}ie grestore XS 0 R /Ms t D} D
1560 /FM {gsave 0 Sg CP MB sub translate XS neg 0 M 0 YS RL XS 0 RL 0 YS neg RL
1561 XS neg 0 RL stroke grestore} D
1562 /NA {/AT E D /AL AL 1 add D AV AL AT put} D
1563 /OA {AL 0 gt{/AL AL 1 sub D /AT AV AL get D}if} D
1564 /D1 {/BR {CP E pop E BN Mb{CP E pop eq{0 YI R}if}{pop}ie} D
1565 /Sn {OU{C1 E ST cvs join ( Ld ) join /C1 E D}{pop}ie} D} D
1566 /D1 {/BR {BN} D /Sn {OU {C1 E ST cvs join ( Ld ) join /C1 E D} {pop} ie} D} D
1567 /TC {/TF t D /ML 0 D HN{SW pop dup ML gt{/ML E D}{pop}ie}forall NP /RM RM not D
1568 RC /OU Tc D Ep /PN 0 D Ms not TP and{Ip}if /W IW ML sub Ts sub D
1569 /A0 0 D TH{/BR {( ) join BT} D /Sn {pop} D /Au () D}if} D
1570 /TN {0 eq{E EA PF HF or not XR and{HN E get Xr}{pop}ie}
1571 {OU{Tn 0 ge{() BN}if /Tn E D}{pop}ie WB}ie} D
1572 /NT {OU LB not and Tn 0 ge and{PL 0 eq{Ms not{CS CF FS}if CP dup
1573 /y E YA sub D W 9 sub CS -1.8 mul XO L1 add 2 add{y M (.) show}for
1574 HN Tn get dup SW pop IW E sub y M show CP BB M}if /Tn -1 D}if} D
1575 /Ld {/DN E D HN DN Pn put [/View [/XYZ -4 Fl{PS}{CP YA add US E pop}ie null]
1576 /Dest DN ST cvs cvn /DEST pdfmark} D
1577 /C {ND 1 eq{1 sub}if TI mul /XO E D NL Nf not{pop()}if 0 3 -1 roll 1 A} D
1578 /OP {BP not{NP}if PN 2 mod 0 eq{NP}if}D
1579 /Ep {Xp PN 2 mod 0 eq and OU and{/Pn (-) D showpage /PM 1 D LA}if}D
1580 /Dg [73 86 88 76 67 68 77] D
1581 /Rd [0 [1 1 0][2 1 0][3 1 0][2 1 1][1 1 1][2 2 1][3 3 1][4 4 1][2 1 2]] D
1582 /Ns {/m E D /c E 32 mul D /j m 1000 idiv D /p j 12 add string D
1583 c 96 le m 0 gt and{c 32 le {/i 0 D /d 77 D /l 100 D /m m j 1000 mul sub D
1584 j -1 1 {pop p i d c add put /i i 1 add D}for
1585 4 -2 0 {/j E D /n m l idiv D /m m n l mul sub D /d Dg j get D
1586 n 0 gt {/x Rd n get D x 0 get -1 1 {pop p i d c add put /i i 1 add D}for
1587 p i x 1 get sub Dg x 2 get j add get c add put}if /l l 10 idiv D
1589 {/i ST length 1 sub D m {1 sub dup 0 ge{dup 26 mod c add 1 add
1590 ST i 3 -1 roll put 26 idiv dup 0 eq{pop exit}if}if /i i 1 sub D}loop
1591 ST i ST length i sub GI}ie}
1593 /US {matrix currentmatrix matrix defaultmatrix matrix invertmatrix
1594 matrix concatmatrix transform} D
1596 /Tl {/Rn E D Xc CP pop ne{
1597 [/Rect [Xc 1 sub Yc cS 0.25 mul sub GB CP E 1 add E cS 0.85 mul add GB]
1598 /Subtype /Link /Border [0 0 Cf Lc and LX and AU or{0}{1}ie] Rn type
1599 /nametype eq {/Dest Rn}{/Action [/Subtype /URI /URI Rn] Cd}ie
1601 /Il {/Rn E D [/Rect [Xc Yc GB Xc XS add Yc YS add GB] /Subtype /Link
1602 /Border [0 0 0] Rn type /nametype eq{/Dest Rn}
1603 {/Action [/Subtype /URI /URI Rn] Cd}ie /ANN pdfmark} D
1604 /XP {[{/Z Bz 2 div D Z 0 R Z Z RL Z neg Z RL Z neg Z neg RL Z Z neg RL
1605 Fi cH 1 eq and{fill}if} {Bz 0 RL 0 Bz RL Bz neg 0 RL 0 Bz neg RL
1606 Fi cH 1 eq and{fill}if} {0 -5 R Bz 0 RL 0 21 RL Bz neg 0 RL 0 -21 RL}]} D
1609 /BX {/Bt E D Bt 2 lt{/Ch E D CS 0.8 mul}{11 mul}ie W XO sub MR sub
1610 2 copy gt{E}if pop /HZ E D Bt 2 eq{Fi not{pop()}if ( )E join /Ft E D TT
1611 /PF t D /MW 1 D /Li 1 D /Fw Ft SW pop D Fw HZ gt{/HZ Fw 8 add D}if
1612 HZ ST cvs( )join}{WB Ch ST cvs( )join}ie L1 HZ add XO add MR add W gt{NL}if
1613 Bt 2 eq{Ft ES Fw neg HM{CS sub}if Pd}if Bt ST cvs join( Bx )join
1614 Bt 2 eq HM and{CS Pd}if C1 E join /C1 E D /L1 L1 HZ add D /T f D
1615 ( ) Pd /PF f D Bt 2 lt{YA CS .8 mul lt{/YA CS .8 mul D}if}
1616 {YB 5 lt{/YB 5 D}if YA 21 lt{/YA 21 D}if}ie /CI 0 D} D
1617 /Bx {dup 2 eq{E /Bz E D}{E /cH E D /Bz CS .8 mul D}ie
1618 OU {gsave 0 Sg XP E get exec stroke grestore}{pop}ie Bz 0 R /Ms t D}D
1619 /SD {FD 4 mul Dy add DZ NF newpath 0 0 M DX t charpath pathbbox
1620 3 -1 roll sub /DY E D E dup /X1 E D sub WM mul WX DY mul add WM DG mul E div
1621 /DF E D /DR WX DF mul DY mul WM div 2 div D} d
1622 /Sd {gsave 0 IL Di mul neg translate IL IW atan Di 0 eq{neg}if rotate
1623 FD 4 mul Dy add DZ NF DR X1 sub DY 2 div neg M cD VC DX show grestore} d
1624 /Pt {/tp t D Tp{NP /Pn (TP) D 0 Tt neg R Th BN NP Ep ET RC ZF}if /tp f D} D
1625 /RC {/AI 0 D /LG 0 D /BC 0 D /UI 0 D /PF f D /Cc 0 D /cC 0 D /Dc 10 array D
1626 /NR [0 1 9{pop 0}for] D /La Ds D /AR 10 array D /TR 10 array D /AV 30 array D
1627 SI /AL -1 D /AT A0 D AT NA /OV 9 array D /Yo 0 D /Co 0 D /Io 0 D /Hy f D
1628 /Ph f D /CL -1 D Ct Sc}D
1629 /ZF {/FR [0 1 30{pop 0}for] D /SZ [0 1 30{pop 0}for] D /FO [0 1 30{pop 0}for] D
1630 /SL 0 D /CF 0 D /FN 0 D 0 Ts SF}D
1631 /QO [[($qo)][($qo2)]] D
1632 /QC [[($qc)][($qc2)]] D
1633 /Hf EF length 2 sub D
1636 /Fz EZ Hf 1 add get D
1637 /Fs Ey Hf 1 add get D
1729 tables E get /table E D
1730 table aload pop /rdesc E D /cdesc E D /tdesc E D
1731 tdesc aload pop /capalg E D /caption E D /rules E D /frame E D /nfoot E D
1732 /nhead E D /ncol E D /nrow E D /border E D /twid E D /units E D /talign E D
1733 /flow E D /clear E D /tclass E D pop pop
1734 /w W D /eps 0.1 D /OU f D /PL 1 D
1735 /FN EF 21 get D EZ 21 get Ey 21 get FS
1740 /cells rdesc irow get 6 get D
1743 /cell cells icol get D
1745 cell aload pop /ang E D /CB E D pop pop pop
1746 /DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
1747 /dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
1749 rspan 0 eq{/rspan nrow irow sub 1 add D}if
1750 cspan 0 eq{/cspan ncol icol sub 1 add D}if
1751 pass 0 eq cspan 1 eq and pass 1 eq cspan 1 gt and or{
1752 /W 1e5 D /LL W D /PH 1 D
1755 AT 4 eq{/CD t D /DC dp D /LN 0 D /M1 0 D /M2 0 D}{/CD f D}ie
1756 0 0 M /LM 0 D proc exec BN
1758 LN array astore cell 15 3 -1 roll put
1759 cdesc icol get dup dup 5 get M1 lt{5 M1 put}{5 get /M1 E D}ie
1760 dup 6 get M2 lt{6 M2 put}{6 get /M2 E D}ie
1764 ang 0 ne{/LM CP E pop neg D}if
1765 /thiswid LM left add right add eps add D
1766 /oldmin 0 D /oldmax 0 D
1768 icol add cdesc E get dup 2 get /oldmax E oldmax add D
1769 1 get /oldmin E oldmin add D
1773 icol add cdesc E get dup 2 E 2 get oldmax 0 eq
1774 {pop thiswid cspan div}{thiswid mul oldmax div}ie
1781 icol add cdesc E get dup 1 E 1 get oldmin 0 eq
1782 {pop thiswid cspan div}{thiswid mul oldmin div}ie
1787 /W 0 D /LL W D /PH 2 D
1788 ctype 1 eq{() ES () BD}if
1789 0 0 M /LM 0 D RC proc exec BN
1790 /thiswid LM left add right add eps add D
1793 icol add cdesc E get dup 1 E 1 get oldmin 0 eq
1794 {pop thiswid cspan div}{thiswid mul oldmin div}ie
1807 cdesc E get dup 1 get E 2 get 2 copy gt{pop dup}if
1808 tmax add /tmax E D tmin add /tmin E D
1810 twid 0 lt{twid neg IW gt{IW neg}{twid}ie /twid E D}if
1811 tdesc 0 twid neg tmin 2 copy lt{E}if pop put
1812 tdesc 1 twid neg tmax 2 copy lt{E}if pop put
1813 /W w D /LL W D /OU t D /PH 0 D /PL 0 D
1817 tables E get /table E D Tm 21 get Ts mul BE
1819 /SL SL 1 add D /FN EF 21 get D EZ 21 get Ey 21 get FS
1820 table aload pop /rdesc E D /cdesc E D /tdesc E D
1821 tdesc aload pop /capalg E D /caption E D /rules E D /frame E D /nfoot E D
1822 /nhead E D /ncol E D /nrow E D /border E D /twid E D /units E D /talign E D
1823 /flow E D /clear E D /tclass E D /tmax E D /tmin E D
1824 /w W D /xo XO D /mr MR D /ll LL D /lg LG D /ai AI D /bc BC D /nr NR D /ar AR D
1825 /tr TR D /ui UI D /ph PH D /a0 A0 D /pf PF D /at AT D /av AV D /al AL D
1827 talign 0 lt{/talign AL 0 gt{AV AL get}{A0 2 le{A0}{0}ie}ie D}if
1829 NL ph 1 eq{tmax}{tmin}ie dup XO add LM gt{/LM E XO add D}{pop}ie LM E
1831 /PH 3 D /LE 1e5 D RC %ZF
1832 border 0 gt{/border 1 D}if
1833 /twidth 0 D /avail W xo sub D
1834 twid 0 eq{0 1 ncol{cdesc E get dup 2 get E 3 get dup 0 gt{div neg dup twid lt
1835 {/twid E D}{pop}ie}{pop pop}ie}for}if
1836 /twid twid dup 0 lt{neg avail 2 copy gt{E}if pop}{avail mul}ie D
1837 /OK t D 0 1 ncol{cdesc E get dup 1 get E 3 get twid mul gt{/OK f D}if}for
1839 cdesc E get dup 1 get /colmin E D dup 3 get /cwid E twid mul D dup
1840 tmax avail le{2 get}if
1841 tmin avail le tmax avail gt and{
1842 dup 2 get E 1 get dup 3 1 roll sub avail tmin sub mul tmax tmin sub div add
1844 tmin avail gt{1 get}if
1845 0 E colmin cwid lt OK and{pop cwid}if dup /twidth E twidth add D put
1849 0 1 ncol{cdesc E get dup 0 get twidth div twid mul 0 E put}for
1852 CP printcap CP E pop sub /caphig E D pop
1857 /cells rdesc irow get 6 get D
1860 /cell cells icol get D
1862 cell aload pop /ang E D /CB E D pop pop pop
1863 /DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
1864 /dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
1866 rspan 0 eq{/rspan nrow irow sub 1 add D}if
1867 cspan 0 eq{/cspan ncol icol sub 1 add D}if
1869 0 1 cspan 1 sub{icol add cdesc E get 0 get /W E W add D}for
1870 pass 0 eq rspan 1 eq and pass 1 eq rspan 1 gt and or{
1872 /W W left sub right sub D /XO 0 D /EO 0 D SI
1873 /A0 align D RC align NA
1875 /DC dp D /DO 0 D /ID 1 D
1876 0 1 DV length 1 sub{DV E get dup DO gt{/DO E D}{pop}ie}for
1877 /Lo DO DV 0 get sub D /L1 Lo D
1879 0 0 M /BP t D /Fl t D /MF 0 D /FB 0 D
1880 proc exec T not{/CI 0 D}if BN 0 FB neg R MF 0 eq{/MF CS D}if
1881 CP /thishig E neg bot add top add CI add D pop
1882 ang 0 ne{/thishig LM bot add top add D}if
1883 cell 16 MF put cell 17 Ya put cell 18 thishig put
1885 /below thishig Ya sub D
1886 rdesc irow get dup dup 4 get Ya lt
1887 {4 Ya put}{4 get /Ya E D}ie
1888 dup 5 get below lt{5 below put}{5 get /below E D}ie
1889 /thishig Ya below add D
1894 irow add rdesc E get 0 get /oldhig E oldhig add D
1898 irow add rdesc E get dup 0 E 0 get oldhig 0 eq
1899 {pop thishig rspan div}{thishig mul oldhig div}ie
1908 /thight 0 D /racc 0 D /maxh 0 D /brk 0 D /rbeg nhead nfoot add D
1910 rdesc E get dup 0 get dup /thight E thight add D
1911 brk 0 eq{/racc E D}{/racc E racc add D}ie
1912 racc maxh gt{/maxh racc D}if 2 get /brk E D
1914 ph 3 ge{thight caphig add E}if
1916 /PH 4 D /LE Le D /OU Ou D /yoff 0 D /headsz 0 D
1917 0 1 nhead 1 sub{rdesc E get 0 get headsz add /headsz E D}for
1919 0 1 nfoot 1 sub{rdesc E nhead add get 0 get footsz add /footsz E D}for
1920 /ahig LE BO add MI add D /maxh maxh headsz add footsz add D
1921 /thight thight headsz add footsz add D
1922 tmin avail gt maxh ahig gt or
1923 {/Sf avail tmin div dup ahig maxh div gt{pop ahig maxh div}if D /SA t D}
1925 tclass 1 eq thight LE 15 sub gt and
1926 {/SA t D LE 15 sub thight div dup Sf lt{/Sf E D}{pop}ie}if
1927 SA{Sf Sf scale /ll ll Sf div D /xo xo Sf div D /LE LE Sf div D
1928 /mr mr Sf div D /BO BO Sf div D /ahig ahig Sf div D}if
1929 nhead nfoot add getwid
1930 LE CP E pop add capalg 0 eq{caphig sub}if
1931 bT{f}{dup thight lt thight ahig lt and}ie
1932 E headsz sub footsz sub rwid lt or{NP}if
1933 capalg 0 eq{printcap -8 SP}if
1936 rbeg 1 nrow{/row E D row
1938 ycur yoff add rwid sub footsz sub LE add 0 lt
1939 {nfoot 0 gt{printfoot}if Tf NP /rbeg irow1 D
1940 Ba{MI /MI MI SA{Sf div}if D MI SP /MI E D}if
1941 CP /ycur E D pop /yoff 0 D printhead}if
1944 printfoot /row row 1 add D Tf
1946 capalg 1 eq{/EO 0 D SI -3 SP printcap}if
1947 Sf 1 lt{1 Sf div dup scale /ll ll Sf mul D /xo xo Sf mul D /LE LE Sf mul D
1948 /mr mr Sf mul D /BO BO Sf mul D /SA f D}if
1952 /W w D /XO xo D /MR mr D /LL ll D /LG lg D /AI ai D /BC bc D /NR nr D /AR ar D
1953 /TR tr D /UI ui D /PH ph D /A0 a0 D /PF pf D /AT at D /AV av D /AL al D
1955 /SL SL 1 sub NN D /CF 0 D /FN 0 D SZ SL get FR SL get FS Wf not{()F2}if
1956 PL 2 ge{Ms E restore Ms or /Ms E D PH 1 eq PH 2 eq or
1957 {/LM E D}if PH 3 ge{/CI 0 D NL 0 E neg R}if
1959 /PL PL 1 sub D /CI 0 D /BP f D /PO f D () Bm 21 get Ts mul BE BL %CF CS SF
1964 {talign 1 eq{/XO xo ll twidth sub 2 div add D}if
1965 talign 2 eq{/XO xo ll twidth sub add D}if
1967 }ie /XO xo D /LL W XO sub MR sub D
1968 /PA f D /Fl capalg 0 eq D
1969 1 NA BL caption exec BN OA /PA t D
1976 {rdesc irow2 get dup 0 get rwid add /rwid E D 2 get 0 eq
1977 {exit}{/irow2 irow2 1 add D}ie
1981 /xoff ll twidth PL 2 ge{Sf div}if sub talign mul 2 div D
1982 /xleft xoff xo add D
1984 /cells rdesc irow get 6 get D
1987 /cell cells icol get D
1989 cell aload pop /ang E D /CB E D /cvsize E D /above E D /fontsz E D
1990 /DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
1991 /dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
1993 rspan 0 eq{/rspan nrow irow sub 1 add D}if
1994 cspan 0 eq{/cspan ncol icol sub 1 add D}if
1996 0 1 cspan 1 sub{icol add cdesc E get 0 get /width E width add D}for
1997 /rhight rdesc irow get 0 get D
1999 1 1 rspan 1 sub{irow add rdesc E get 0 get /hight E hight add D}for
2000 /W xo xoff add width add right sub D
2001 ang 0 ne{/W xo xoff add hight add right sub D}if
2002 /EO xo xoff add left add D SI
2004 gsave CB VC xo xoff add ycur yoff add M
2005 0 hight neg RL width 0 RL 0 hight RL width neg 0 RL fill
2011 /DC dp D /ID 1 D /DO cdesc icol get 5 get D /Lo DO DV 0 get sub D /L1 Lo D
2015 {xoff ycur add hight cvsize sub 2 div sub ycur hight sub xoff sub}
2016 {xoff ycur sub width add hight cvsize sub 2 div add ycur xoff add}ie
2017 translate ang rotate
2019 valign 3 le{0 ycur yoff add top sub
2020 hight cvsize sub valign 1 sub mul 2 div sub M}
2021 {0 ycur yoff add top sub above add rdesc irow get 4 get sub M}ie
2022 /PA f D /BP t D /Fl t D
2024 ang 0 ne{grestore}if
2028 /xoff xoff cdesc icol get 0 get add D
2030 /yoff yoff rhight sub D
2032 /printhead {0 1 nhead 1 sub{printrow}for} D
2033 /printfoot {nhead 1 nhead nfoot add 1 sub{printrow}for} D
2035 OU{rules 2 ge{/yoff 0 D
2037 [0 1 nhead 1 sub{}for rbeg 1 row 1 sub{}for nhead 1 nhead nfoot add 1 sub{}for]{
2039 /xoff ll twidth PL 2 ge{Sf div}if sub talign mul 2 div D
2040 /cells rdesc irow get 6 get D
2043 /cell cells icol get D
2047 rspan 0 eq{/rspan nrow irow sub 1 add D}if
2048 cspan 0 eq{/cspan ncol icol sub 1 add D}if
2050 0 1 cspan 1 sub{icol add cdesc E get 0 get /width E width add D}for
2051 /rhight rdesc irow get 0 get D
2053 1 1 rspan 1 sub{irow add rdesc E get 0 get /hight E hight add D}for
2054 xo xoff add width add ycur yoff add M
2055 0 hight neg icol cspan add 1 sub ncol lt
2056 {cdesc icol 1 add get 4 get dup rules 3 le{1 eq}{pop t}ie
2058 LW RL CP stroke M}{pop R}ie}{R}ie
2059 irow nhead nfoot add 1 sub ne nfoot 0 eq or
2060 {irow rspan add 1 sub nrow lt
2061 {rdesc irow rspan add get 3 get}{nfoot 0 eq{0}{1}ie}ie
2062 dup rules 2 mod 0 eq{1 eq}{pop t}ie
2063 {1 eq irow rspan add nhead eq or irow rspan add row eq nfoot 0 gt and or
2064 {0.8}{0.3}ie LW width neg 0 RL CP stroke M}{pop}ie}if
2066 /xoff xoff cdesc icol get 0 get add D
2068 /yoff yoff rhight sub D
2077 0 yoff frame 5 eq frame 7 ge or{RL}{R}ie
2078 twidth 0 frame 3 eq frame 4 eq or frame 8 ge or{RL}{R}ie CP BB
2079 0 yoff neg frame 6 ge{RL}{R}ie
2080 twidth neg 0 frame 2 eq frame 4 eq or frame 8 ge or{RL}{R}ie
2091 $tables="/tables [";
2092 @docs=$#ARGV<0?("-"):@ARGV;
2093 if($tocdoc) {$#docs=0};
2094 for (@docs) {$levl{$_}=1};
2100 $toc=$first?"Pt\n":"";
2101 $toc.="/BO 0 D TC /Ba f D Bs /AU f D /UR () D RC ZF\n";
2102 $toc.="()F2" if(!$latin1);
2103 $toc.="tH WB\n" if(!$tocdoc);
2108 while($html=shift @docs) {
2114 $level=$levl{$html};
2119 $toc=~s/[\200-\377]+/)F1($&)F2(/g if(!$latin1);
2122 @docs=(@docs,@links);
2124 @docs=(@links,@docs);
2127 if($rem && $opt_W) {
2128 &dbg("At least $rem document".($rem>1?"s":"")." remaining\n");
2131 $_="/Ba t D /BA {($banner)BN} D\nBs f Pb CP /BO E D pop\n";
2135 $_="/Ba f D /BO 0 D Bs";
2137 if($tocdoc && $first && $ndoc==1) {
2139 $et=" NP Ep ET /Tc f D";
2144 $_.="\n/UR ($html) D\n/Ti ($ti) D\n/Au ($au) D\n/Df $draft D\n/ME [";
2145 for $i (sort {$metarc{$a} <=> $metarc{$b}} keys %metarc){
2149 if($ndoc==1) {$top=$_};
2151 $toc.="ND 1 gt{Ts 3 mul Np $refs{$html}()0 C()BD($ti)ES()$refs{$html}"
2152 ." 1 TN()EA()BN}if\n";
2155 while($P2=~s/(\d) (\d) H\(([^\s<)]*)/$1 $2 $nhd H($3)WB $nref Sn(/) {
2165 for $i ($hv..5) {$hind[$i]=0};
2166 $hind=join('.',@hind[0..$hv-1]);
2169 ($htxt=$hst.$`)=~s/\)EA\(//g;
2171 $toc.="$hv NH le{$nref($hind\\240\\240)$hv C($htxt)$nref 1 TN()EA()BN}if\n";
2176 $htxt=~s/(\s+|\)BR\()/ /g;
2177 $htxt=~s/(^\s+|\)[^(]*\(|\s+$)//g;
2178 $htxt="" if(!$latin1);
2179 $dh.="/h$nhd [($hind\\240\\240)($htxt)] D\n";
2182 if($ndoc==1 && !$first) {
2183 $toc="TC RC ZF $_ $P2 WB () BN\n";
2190 $P3.="$fl1\n/Cb $bg D /Ct $tcol D /Cl $lcol D /CL -1 D Ct Sc\n";
2191 if($ndoc==1 && !$first) {$P3.="Pt\n"};
2192 $P3.="$fl2\n$_\n$np\n$P2";
2193 if($tocdoc && $ndoc==1 && !$first) {
2194 $np="/Cb $bg D NP RC ZF";
2203 $P3.=($P3!~/\)\s*$/?"()":"")."WB NL";
2204 if(!$tocdoc && $first && $nhd){$P3="$toc/OU t D /Cb $bg D NP Ep ET $P3"};
2205 if(!$first && ($tocdoc || !$tocdoc && $nhd)){$P3.=" $toc"};
2211 s/[\200-\377]/sprintf("\\%3.3o",ord($&))/eg;
2216 $_="%!PS\n%%Title: $title\n$P0$P1";
2218 $_.="/AX [".join(' ',@XS)."] D\n/AY [".join(' ',@YS)."] D\n"
2219 ."/IX [".join(' ',@IX)."] D\n/IT [".join(' ',@IT)."] D\n";
2221 $_.="/AZ [".join(' ',@DP)."] D\n/WS [".join(' ',@WS)."] D\n"
2222 ."/FC [".join(' ',@FC)."] D\n/NI $nm D\n/BM ".($nm+1)." array D\nSB\n";
2223 for $i (0..$nm) {$_.="$BM[$i]\n\n"}
2225 $_.="\n$pv%Endpv\n" if($nps);
2227 @kw=split(/[, ]+/,$kw);
2229 for $i (@kw){push(@Kw,$i) if(!grep(/^$i$/,@Kw))};
2234 while($j++<=$#z2 && $z2[$j]>$z2[$i]) {$n++ if($z2[$j]==$z2[$i]+1)};
2237 $tdef=$ntab>=0?"$tbl$tables\n0 1 $ntab\{TS}for RC ZF\n":"";
2238 $hd="/Hr [@z1]D\n/HV [@z2]D\n/Cn [@z3]D";
2241 $sd="/Df t D /DG IW IW mul IL IL mul add sqrt D IW IL IW IL lt{E}if"
2242 ." /WM E D /WX E D /DZ 180 D gsave SD /DZ DZ DF mul D SD grestore\n";
2247 [/Creator ($version) /Author ($Au) /Keywords ($kw) /Subject ($su)
2248 /Title ($title) /DOCINFO pdfmark
2250 /HN [1 1 $nref\{pop (??)}for] D
2252 Hr length 0 gt{[/PageMode /UseOutlines /DOCVIEW pdfmark}if
2254 0 1 Hr length 1 sub{
2255 /Bn E D [Cn Bn get dup 0 gt{/Count E HV Bn get Bl ge{neg}if}{pop}ie
2256 /Dest Hr Bn get dup abs ST cvs cvn E 0 ge{(h)Hn ST cvs join cvx exec
2257 dup 1 get E Nf{0 get E join}{pop}ie /Hn Hn 1 add D}{()}ie
2258 /Title E dup length 255 gt{0 255 getinterval}if /OUT pdfmark}for
2259 ZF /FN Fp D Ps 0 FS /WC Wf{( )}{<A1A1>}ie SW pop D
2262 /TE t D NP TU PM 0 eq and{/Pn () D showpage}if end restore
2265 if(($first || $opt_R) && $xref{'passes'}) {
2266 &dbg("Inserting cross references\n") if($opt_d);
2267 for $i (1..$xref{'passes'}) {&ref};
2274 } elsif($html=~m|://|) {
2275 if(($prompt || $nrem>50) && $level>1) {
2276 &prompt("Retrieve document $html (y/n/q)? ",$ans);
2277 if($ans=~/q/i) {undef @docs};
2278 return 0 unless($ans=~/y/i);
2280 &geturl($html,$_) || return;
2282 if($contyp!~m|text/html|i) {$_=" <plaintext>\n$_"};
2283 unless(($ba2)=$html=~m|(.*://.*/)|) {$ba2=$html."/"};
2285 if(open(FILE,$html)) {
2286 &dbg("Reading $html\n") if($opt_W || $opt_d);
2288 if(!/<HTML/i && $html!~/html?$/i && ($html!~/\.ps$/i || $ndoc>1)) {
2289 $_=" <plaintext>\n$_";
2292 $var{DOCUMENT_NAME}=$html;
2294 $var{LAST_MODIFIED}=POSIX::strftime("%c",localtime((stat $html)[9]));
2295 $var{DATE_LOCAL}=POSIX::strftime("%c",@now);
2296 $var{DATE_GMT}=POSIX::strftime("%c",@gmnow);
2298 $mod=(stat $html)[9];
2300 &dbg("*** Error opening $html\n");
2305 if(/^%!/ && /$delim/) {
2309 for $s ("b","c","cw","g","t") {
2310 &dbg("Option -$s ignored\n") if(eval "\$opt_$s");
2316 $head=~/<title$R\s*([\w\W]*)<\/title/i;
2317 ($ti=$2)=~s/\s+/ /g;
2318 $ti=$doctit{$html} if(!$ti);
2322 $ti="<Untitled>" if(!$ti);
2323 $title=$ti if(!$title);
2324 $draft="f" if(!$ddr);
2327 while($head=~/<meta\s[^>]*(name|http-equiv)\s*=\s*["']?\s*(\w+)$R/gi) {
2329 ($v)=$&=~/content\s*=\s*["']\s*([^"']+)/i;
2335 if($k=~/author/) {$au=$au?"$au, $v":$v};
2336 if($k=~/keywords/) {$kw=$kw?"$kw, $v":$v};
2337 if($k=~/subject/ && !$su) {$su=$v};
2338 if(!$ddr && $k=~/status/ && $v=~/draft/i) {$draft="t";$gd=1};
2340 $Au.=($Au?" + ":"").$au if($au);
2343 ($b2)=$head=~/<base\s+href\s*=\s*"([^"]*)"$R/i;
2344 unless($b2) {($b2)=$head=~/<base\s+href\s*=\s*([\w\.-]+)$R/i}
2345 unless($b2) {$b2=$ba2}
2348 ($b1)=$b2=~m|(.*://[^/]*)/|;
2349 unless($b1) {$b1=$opt_r};
2350 unless($b2) {$b2=$html=~m|(.*/)[^/]*$|?$1:""};
2351 if(!defined $B2) {$B2=$b2};
2352 $levl{$b2.$html}=$levl{$html};
2354 while($link && $head=~/<link\s+[^>]*rel\s*=\s*["']?next$R/gi) {
2355 if(($lnk)=$&=~/href\s*=\s*["']?\s*([^"' >]*)/gi) {
2356 if($lnk=~m|.+//[^/]+$|) {$lnk=$&."/"}
2361 if($lnk=~m|^/|) {$lnk=$b1.$lnk} else {$lnk=$b2.$lnk}
2363 while($lnk!~m|^\.\./| && $lnk=~m|[^/]*/\.\./|) {$lnk=$`.$'};
2365 if(&follow && !$levl{$lnk}) {
2366 $levl{$lnk}=$level+1;
2371 ($battr)=/<BODY$R/i;
2372 ($lang)=$battr=~/\slang\s*=\s*['"]?([a-zA-Z-]+)/i;
2373 ($lang)=$head=~/<html[^>]+lang\s*=\s*['"]?([a-zA-Z-]+)/i if(!$lang);
2374 $lang=$opt_l if($opt_l);
2375 $lang='en' if(!$lang);
2377 if($battr=~/\stext\s*=\s*['"]?\s*#?(\w+)/i) {$tcol=&col2rgb($1)};
2378 if(!$tcol) {$tcol="Dt"};
2379 if($battr=~/\slink\s*=\s*['"]?\s*#?(\w+)/i) {$lcol=&col2rgb($1)};
2380 if(!$lcol) {$lcol="Dl"};
2381 &inihyph if($opt_H);
2382 ($bg)=$battr=~/BGCOLOR\s*=\s*["']?\s*#?(\w+)/i;
2385 ($red,$grn,$blu)=@cvec;
2387 ($red,$grn,$blu)=$bgcol=~/#(\w+).*#(\w+).*#(\w+)/;
2392 while(/<object$R/i) {
2396 $type=$tag=~/type\s*=\s*($S)/i?$+:"";
2397 $uaddr=$tag=~/data\s*=\s*($S)/i?$+:"";
2398 if($type=~/^text\/(html|plain)$/i
2399 || !$type && $uaddr=~m"(\.html?|://.+/|://[^/]+)$"i) {
2400 $tag=~/data\s*=\s*/i;
2401 if(&open($uaddr,$idoc)) {
2402 if($type=~/plain/i) {
2403 $idoc="<XMP>$idoc</XMP>";
2408 $_.=$' if($end=~/<\/object>/i);
2410 &dbg("\n*** Error opening $uaddr\n");
2420 if($opt_c && defined $package{'check'}) {
2423 open(SCRATCH,">$scr");
2428 &dbg(`$package{'check'} $file`);
2432 if($opt_e=~/EUC-/i) {
2433 s/([\216\217\241-\376].)+/\000$&\000/g;
2435 s/\000(.+?)\000/)F1($1)F2(/g;
2436 } elsif($opt_e=~/SHIFT-JIS/i) {
2437 s/[\201-\237\340-\374][@-~\200-\374]/$&\000/g;
2438 s/[\241-\337]+(?!\000)/$&\000/g;
2439 s/[ -~\t\n\r\240]+(?!\000)/\002$&\001/g;
2443 while(/\e\$B([^\e]*)/) {
2448 $_="$beg\001$mat$end";
2456 y/\000-\010\013\016-\037\177//d;
2459 y/\000-\010\013\016-\037\177-\237//d;
2462 $refs{$html}=$nref++ if(!defined $refs{$html});
2463 $_="\004$lang\004)WB $refs{$html} Sn($_";
2465 # Yes, I know Perl has case-insensitive pattern matching. But on my system
2466 # it takes about 10 times longer to run!
2469 if(/<[pP][lL][aA][iI][nN][tT][eE][xX][tT]$R/) {$_=$`;$pt=$'};
2471 if(/(<[lL][iI][sS][tT][iI][nN][gG]$R)/) {$_=$`; $tag=$1; $rest=$';
2472 if(/<[xX][mM][pP]$R/){$_=$`; &Subst($_); $P2.="$_)XX("; $_=$'.$tag.$rest;
2473 if(m|</[xX][mM][pP]$R|) {$P2.="$`)RP("; $_=$'}
2474 else {$P2.=$'; $_=""}}
2475 else {&Subst($_); $P2.="$_)XX("; $_=$rest;
2476 if(m|</[lL][iI][sS][tT][iI][nN][gG]$R|) {$P2.="$`)RP("; $_=$'}
2477 else {$P2.=$'; $_=""}}}
2478 elsif(/<[xX][mM][pP]$R/) {$_=$`; &Subst($_); $P2.="$_)XX("; $_=$';
2479 if(m|</[xX][mM][pP]$R|) {$P2.="$`)RP("; $_=$'}
2480 else {$P2.=$'; $_=""}}
2481 else {&Subst($_);$P2.=$_; $_=""}
2484 if($pt) {$P2.=")XX($pt"};
2486 if($plain) {$P2.="RP ()"};
2487 while($P2=~/XX\(/) {
2492 $mat=~s/(.*\n){30}.*/$&)WR(/g;
2493 ($temp=$mat)=~s/\)[^(]+\(//g;
2494 @prel=split(' *\n',$temp);
2498 while($line=~/\t+/) {
2499 $sp=' ' x (length($&)*8-length($`)%8);
2504 $maxl=$ll if($ll > $maxl);
2506 $P2="$beg ".($#prel+1)." $maxl PR($mat$end";
2508 $P1=~s/[\200-\377]/sprintf("\\%3.3o",ord($&))/eg;
2509 $P2=~s/[\200-\377]/sprintf("\\%3.3o",ord($&))/eg;
2516 s/<!--NewPage-->/$pc/g;
2517 s/<(\?|hr\s+class\s*=\s*["']?)\s*page-break$R/$pc/gi;
2519 s/<!--OddPage-->/)WB NL OP(/g;
2520 if($ssi && $html!~m|://|) {
2521 while(/<!--#(include|config|echo)\s+(\w+)\s*="([^"]+)"\s*-->/) {
2524 if($1 eq "include" && (substr($file,0,1) ne "/" || $opt_r)) {
2525 if(substr($file,0,1) ne "/") {
2527 } elsif($2 eq "virtual") {
2530 if(open INC,$file) {
2535 } elsif ($1 eq "config" && $2 eq "timefmt") {
2537 $var{LAST_MODIFIED}=POSIX::strftime($3,localtime((stat $html)[9]));
2538 $var{DATE_LOCAL}=POSIX::strftime($3,@now);
2539 $var{DATE_GMT}=POSIX::strftime($3,@gmnow);
2541 } elsif ($1 eq "echo") {
2547 s/(­?|­?|<!--hy-->)/)HY(/g;
2554 while(/<([^"'>]*=\s*["'])/) {
2557 while(/^[^"'>]*=\s*(["'])/) {
2561 ($tg=$`)=~y/>/\003/;
2568 $a='[aA][lL][iI][gG][nN]';
2569 $Y='[sS][tT][yY][lL][eE]';
2570 $A="($a\\s*=\"?|$Y\\s*=\\s*\"?[tT][eE][xX][tT]-\\s*$a:)";
2571 $I='[lL][eE][fF][tT]';
2572 $C='[cC][eE][nN][tT][eE][rR]';
2573 $D='[rR][iI][gG][hH][tT]';
2574 $J='[jJ][uU][sS][tT][iI][fF][yY]';
2575 $s='[sS][eE][lL][eE][cC][tT]';
2576 $F='[fF][oO][nN][tT]';
2577 $U='[cC][oO][lL][oO][rR]';
2578 $O='[cC][oO][mM][pP][aA][cC][tT]';
2579 s/<\w+[^>]*\s+[iI][dD]\s*=\s*($S)[^>]*>/$&<a name="$+">/g;
2580 s|<[dD][eE][lL]$R[\w\W]*?</[dD][eE][lL]>||g if($del{'display'}=~/^none$/);
2582 s|</?[dD][iI][vV]\d$R||g;
2583 s|<(/?)([dD][iI][vV])([>\s])|"<$1$2".($1?--$ndiv:$ndiv++).$3|eg;
2584 while(/<[dD][iI][vV](\d+)$R/) {
2591 if($2=~/class\s*=\s*["']?noprint$R/i) {
2593 $_.=$' if($dend=~/<\/[dD][iI][vV]$dnum>/);
2595 if($dattr=~/$A\s*($I|$C|$D|$J)/) {
2596 $div.=")".$algn{"\L$2"}." Al(";
2599 if($dattr=~/lang\s*=\s*["']?([a-zA-Z-]+)/i) {
2601 $div.="\004$lang\004";
2602 &inihyph if($opt_H);
2603 $dbeg=~/(\004[^\004]*\004)[^\004]*$/;
2606 $dend=~s|</[dD][iI][vV]$dnum>|$ediv)BR(|;
2607 $_="$dbeg$div)BR($dend";
2612 s|<(\w+)/([^/]+)/|<$1>$2</$1>|g;
2613 s/(<\w+[^>]*>)\n|\n(<\/\w+>)/$+/g;
2614 s|(<[lL][iI])$R\s*<[pP]>|)0 P($1$2|g;
2615 s/<[hH]([1-6])\s+$A\s*($I|$C|$D|$J)$R/)$algn{"\L$3"} $1 H(/g;
2616 s|<[hH]([1-6])$R|)0 $1 H(|g;
2617 s|</[hH][1-6]>|)EH(|g;
2618 s|<[bB][rR]$R|)BR(|g;
2619 s/<[pP]\s+[^>]*$A\s*($I|$C|$D|$J)$R/)$algn{"\L$2"} P(/g;
2622 s|<[aA][dD][dD][rR][eE][sS][sS]$R|)AD(|g;
2623 s|</[aA][dD][dD][rR][eE][sS][sS]>|)DA(|g;
2624 s|<[pP][rR][eE]$R\n?|)XX(|g;
2625 s|\n? *</[pP][rR][eE]>|)RP(|g;
2626 s|<[dD][tT]\s[^>]*$O$R|)1 DT(|g;
2627 s|<[dD][tT]$R|)0 DT(|g;
2628 s|<[dD][dD]$R|)DD(|g;
2629 s|<[dD][lL]\s[^>]*$O$R|)1 DL(|g;
2630 s|<[dD][lL]$R|)0 DL(|g;
2631 s|</[dD][lL]>|)LD(|g;
2632 s|<[uU][lL]$R|)UL(|g;
2633 s|</[uU][lL]>|)LU(|g;
2634 s|<[mM][eE][nN][uU]$R|)UL(|g;
2635 s|</[mM][eE][nN][uU]>|)LU(|g;
2636 s|<[dD][iI][rR]$R|)UL(|g;
2637 s|</[dD][iI][rR]>|)LU(|g;
2638 s|<[oO][lL]\s[^>]*[sS][tT][aA][rR][tT]\s*=\s*['"]?(-?\d+)$R|$&)WB $1 Ln(|g;
2639 s|<[oO][lL]\s[^>]*[tT][yY][pP][eE]\s*=\s*['"]?([1iIaA])$R|)$lity{$1} OL(|g;
2640 s|<[oO][lL]$R|)4 OL(|g;
2641 s|</[oO][lL]>|)LO(|g;
2642 s|<[lL][iI]\s[^>]*[vV][aA][lL][uU][eE]\s*=\s*['"]?(-?\d+)$R|$&)WB $1 Ln(|g;
2643 s|<[lL][iI]\s[^>]*[tT][yY][pP][eE]\s*=\s*['"]?($ltr)$R|)$lity{$1} LI(|g;
2644 s|<[lL][iI]$R|)-1 LI(|g;
2646 s"<([bB][qQ]|[bB][lL][oO][cC][kK][qQ][uU][oO][tT][eE])$R")BQ("g;
2647 s"</([bB][qQ]|[bB][lL][oO][cC][kK][qQ][uU][oO][tT][eE])>")QB("g;
2648 s|<[sS][tT][rR][oO][nN][gG]$R|)BD(|g;
2649 s|</[sS][tT][rR][oO][nN][gG]>|)ES(|g;
2650 s|<[sS][aA][mM][pP]$R|)SM(|g;
2651 s|</[sS][aA][mM][pP]>|)ES(|g;
2652 s|<[qQ]$R(\s*)|$2)Q(|g;
2653 s|(\s*)</[qQ]>|)EQ($1|g;
2654 s|<[cC][iI][tT][eE]$R|)CT(|g;
2655 s|</[cC][iI][tT][eE]>|)ES(|g;
2656 s|<[vV][aA][rR]$R|)I(|g;
2657 s|</[vV][aA][rR]>|)ES(|g;
2662 s|<[tT][tT]$R|)TT(|g;
2663 s|</[tT][tT]>|)ES(|g;
2666 s|<[sS]([tT][rR][iI][kK][eE])?$R|)SE(|g;
2667 s|</[sS]([tT][rR][iI][kK][eE])?>|)XE(|g;
2668 s|<[dD][fF][nN]$R|)I(|g;
2669 s|</[dD][fF][nN]>|)ES(|g;
2670 s|<[eE][mM]$R|)EM(|g;
2671 s|</[eE][mM]>|)ES(|g;
2672 s|<[cC][oO][dD][eE]$R|)SM(|g;
2673 s|</[cC][oO][dD][eE]>|)ES(|g;
2674 s|<[kK][bB][dD]$R|)KB(|g;
2675 s|</[kK][bB][dD]>|)ES(|g;
2676 s|<[bB][iI][gG]$R|)4 FZ(|g;
2677 s|</[bB][iI][gG]>|)ES(|g;
2678 s|<[sS][mM][aA][lL][lL]$R|)2 FZ(|g;
2679 s|</[sS][mM][aA][lL][lL]>|)ES(|g;
2680 s|<[iI][nN][sS]$R|)sM WB(|g;
2681 s|</[iI][nN][sS]>|)WB eM(|g;
2682 s|<[dD][eE][lL]$R|)sM $lt(|g;
2683 s|</[dD][eE][lL]>|)XE eM(|g;
2684 s|<[aA][cC][rR][oO][nN][yY][mM][^>]+[tT][iI][tT][lL][eE]\s*=\s*($S)[^>]*>|)($+)Ac(|g;
2685 s|</[aA][cC][rR][oO][nN][yY][mM]>|)Ca(|g;
2686 s|<[fF][oO][rR][mM][\w\W]*?</[fF][oO][rR][mM]>||g if(!$forms);
2687 s|</?[fF][oO][rR][mM]$R|)Ts BE(|g;
2688 s/<$s[^>]*[mM][uU][lL][tT][iI][pP][lL][eE]$R/)1 MS(<table>/g;
2689 s/<$s$R/)0 MS(<table>/g;
2691 s/<[oO][pP][tT][iI][oO][nN]$R/<tr><td>)O(/g;
2692 while(/<[iI][nN][pP][uU][tT]$R/) {
2697 if($iattr=~/type\s*=\s*["']?(\w+)/i) {$it=$it{"\L$1"}};
2699 $it=($iattr=~/\schecked\W/i?1:0) ." $it";
2701 $siz=$iattr=~/size\s*=\s*["']?(\d+)/i?$1:12;
2702 $ival=$iattr=~/value\s*=\s*($S)/i?$+:"";
2703 $it="($ival)$siz $it";
2706 $cmd=$it==3?"<img $iattr":")$it BX(";
2712 while(/<[tT][eE][xX][tT][aA][rR][eE][aA]$R/) {
2716 if($rest=~m|</[tT][eE][xX][tT][aA][rR][eE][aA]>|) {
2718 $data=$prefilled||$textarea_data?$`:"";
2721 if($txatr=~/rows\s*=\s*["']?(\d+)/i) {$rows=$1};
2722 if($txatr=~/cols\s*=\s*["']?(\d+)/i) {$cols=$1};
2723 $nl=$data=~y/\n/\n/;
2724 for ($nl..$rows) {$data.="\n"};
2725 $data=~/(.*\n){$rows}/;
2726 $tfont=$prefilled?"TT":"0 FZ";
2727 ($data=$&)=~s/.*\n/<tr height=24><td valign=top>)$tfont($&)ES(/g;
2729 $frame=$prefilled?"frame=box":"border";
2730 $_="$beg<table $frame width=$wi cellpadding=2>$data</table>$rest";
2736 s|<(/?)($F)([>\s])|"<$1$2".($1?--$nfnt:$nfnt++).$3|eg;
2737 while(/<$F(\d+)([^>]*)$U\s*=\s*["']?\s*#?(\w+)$R/) {
2739 $_=$`.($rgb?")WB $rgb Sc(":"")."<font$2$4";
2741 $temp=~s|</$F$1>|</font>)Ec(| if($rgb);
2744 $base{"+"}="Bf add ";
2745 $base{"-"}="Bf add ";
2746 s/<$F\d*\s[^>]*[sS][iI][zZ][eE]\s*=\s*["']?([+-]?)(\d+\.?\d*)$R/)$1$2 $base{$1}FZ(/g;
2747 s|<$F\d*$R|)3 FZ(|g;
2749 s|<[bB][aA][sS][eE]$F\s[^>]*[sS][iI][zZ][eE]\s*=\s*["']?(\d+)$R|)$1 BZ(|g;
2750 while(/(<[aA]\s+[^>]*)[nN][aA][mM][eE]\s*=\s*(["']?)([^"'\s>]*)$R([^\s<)]*)/) {
2752 $refs{$lnk}=$nref++ unless(defined $refs{$lnk});
2753 $_="$`$1$4$5)WB $refs{$lnk} Sn($'";
2755 while(/<[aA]\s+[^>]*[hH][rR][eE][fF]\s*=\s*["']?\s*([^"'\s>]*)$R/) {
2760 $revtoc=$tag=~/rev\s*=['"]?\s*toc/i;
2768 if($lnk=~m|.+//[^/]+$|) {$lnk=$&."/"}
2773 if($lnk=~m|^/|) {$lnk=$b1.$lnk} elsif($lnk!~m|^\w+:|) {$lnk=$b2.$lnk};
2775 while($lnk!~m|^\.\./| && $lnk=~m|[^/]*/\.\./|) {$lnk=$`.$'};
2776 $lnk=~s"(^|/)\./"$1"g;
2777 ($doc)=$lnk=~/([^#]*)/;
2778 ($doctit{$doc})=$tag=~/title\s*=['"]([^'"]*)['"]/i;
2781 if($loc || grep(/^\Q$doc\E$/,(@docs,@links))
2782 || $opt_W && !$link && $level<=$maxlev && &follow){
2783 $refs{$lnk}=$nref++ unless(defined $refs{$lnk});
2784 $anch="$refs{$lnk} 1";
2785 $ltype=$rev && $revtoc && $ndoc==1 || $opt_C=~/f/ && $ndoc==1?1:0;
2786 $rest=~s|</a>|)$refs{$lnk} $ltype TN TL()Ec /AF f D(|i;
2787 if(&follow && !$levl{$doc}) {
2788 &dbg("Link: $doc\n") if($opt_d);
2789 $levl{$doc}=$level+1;
2792 } elsif(defined $refs{$lnk}) {
2793 $anch="$refs{$lnk} 1";
2795 $addr=$dum{$lnk}?"R$dum{$lnk}":0;
2796 if(!$dum{$lnk} && $lnk=~m|://|) {
2798 $rfs.="/R$dum{$lnk} ($lnk) D\n";
2799 $addr="R$dum{$lnk}";
2801 $_=$beg.")$addr $anch A(".$rest;
2804 if((!$mult || $doc_sep eq $pc && $mult)
2805 && m|<[bB][aA][nN][nN][eE][rR]$R([\w\W]*)</[bB][aA][nN][nN][eE][rR]>|) {
2809 while(/<[tT][aA][bB][lL][eE]([^>]*)>/) {
2814 $rest=~/(<\/[tT][aA][bB][lL][eE]>|$)/;
2817 while($table=~/<[tT][aA][bB][lL][eE]([^>]*)>/) {
2823 ($tla)=$tattr=~/lang\s*=\s*["']?([a-zA-Z-]+)/i;
2824 if(!$tla) {($tla)=$beg=~/\004_?([^\004]*)\004[^\004]*$/};
2836 ($capat,$cap)=$table=~m|<caption$R([\w\W]*)</caption>|i;
2837 $capat=~/ALIGN\s*=\s*["']?\s*(\w+)/i;
2839 $capa=1 if("\L$1" eq "bottom");
2840 $capa=-1 if($cap!~/\S/);
2842 if($tattr=~/border/i) {
2843 ($bord)=$'=~/^\s*=\s*["']?(\d+)/;
2844 if(!$bord && $bord ne "0") {$bord=1};
2846 ($talgn)=$tattr=~/ALIGN\s*=\s*["']?\s*(\w+)/i;
2848 $tal=0 if($talgn=~/^left$/i);
2849 $tal=1 if($talgn=~/^center$/i);
2850 $tal=2 if($talgn=~/^right$/i);
2851 ($fra)=$tattr=~/FRAME\s*=\s*["']?\s*(\w+)/i;
2852 if($fra && $f{"\L$fra"}) {$fra=$f{"\L$fra"}} else {$fra=$bord?9:1};
2853 ($rul)=$tattr=~/RULES\s*=\s*["']?\s*(\w+)/i;
2854 if($rul && $r{"\L$rul"}) {$rul=$r{"\L$rul"}} else {$rul=$bord?5:1};
2855 unless(($twid)=$tattr=~/WIDTH\s*=\s*["']?(\d+\.?\d*%?)/i) {$twid=0};
2856 $twid=$twid=~/%$/?$`/100:-$twid;
2857 ($cpad)=$tattr=~/CELLPADDING\s*=\s*["']?\s*$V/i;
2858 if($tattr=~/CELLSPACING\s*=\s*["']?\s*$V/i && $1!=0) {$cpad+=$1/2};
2859 ($tbg)=$tattr=~/BGCOLOR\s*=\s*["']?\s*#?(\w+)/i;
2860 $tbg=&col2rgb($tbg);
2861 ($tcl)=$tattr=~/CLASS\s*=\s*["']?\s*(\w+)/i;
2862 $tcl="\L$tcl" eq "telelista"? 1: 0;
2870 while($table=~/<[cC][oO][lL]([^>]*>)/g && $span>0) {
2874 $cola=~/(^|\s)ALIGN\s*=\s*["']?\s*(\w+)/i;
2876 ($val)=$cola=~/VALIGN\s*=\s*["']?\s*(\w+)/i;
2878 ($odc)=$cola=~/CHAR\s*=\s*["']?(.)/i;
2879 unless(($wid)=$cola=~/WIDTH\s*=\s*["'](\d+%?)/i) {$wid=0};
2880 if($wid=~/%$/) {$wid=$`/100};
2881 ($span)=$cola=~/SPAN\s*=\s*["']?\s*(\d+)/i;
2882 if(!$span && $span ne "0") {$span=1};
2884 if($cola=~/^GROUP/i) {
2890 if($aft=~/<COL\s/i) {
2891 $us=$`=~m|</?COLGROUP|i;
2894 while($ab=~/<COLGROUP/i) {$ab=$'};
2895 if($ab=~m|</COLGROUP|i) {
2901 if(!$alg) {$alg=$gal};
2902 if(!$val) {$val=$gva};
2903 if(!$odc) {$odc=$gdc};
2904 if(!$wid) {$wid=$gwi};
2926 $table=~/<t[hd][\s>]/i;
2927 if($`!~/<tr/i) {$table="<TR>$table"};
2933 unless($table=~/<tbody$R/i || $table=~s|</tfoot>|$&<tbody>|i) {
2934 $table=~s|</thead>|$&<tbody>|i;
2936 while($table=~/<[tT][rR]\s*([^>]*)>/g) {
2942 $cells{"$nrow,$j,0"}=1;
2945 if($ab=~/<tbody$R/i) {
2947 while($ab=~/<[tT][bB][oO][dD][yY]$R/g) {
2956 if($ab=~/<tfoot$R/i) {
2959 } elsif($ab=~/<thead$R/i) {
2964 $battr=~/(^|\s)ALIGN\s*=\s*["']?\s*(\w+)/i;
2965 $balgn=$algn{"\L$2"};
2966 $battr=~/VALIGN\s*=\s*["']?\s*(\w+)/i;
2968 ($bdc)=$battr=~/CHAR\s*=\s*["']?(.)/i;
2971 $rd{"$nrow,2"}=0 unless($rd{"$nrow,2"});
2972 $rd{"$nrow,3"}=$rgrp;
2973 $rattr=~/(^|\s)ALIGN\s*=\s*["']?\s*(\w+)/i;
2974 $ralgn=$algn{"\L$2"};
2975 $rattr=~/VALIGN\s*=\s*["']?\s*(\w+)/i;
2977 ($rla[$nrow])=$rattr=~/lang\s*=\s*["']?([a-zA-Z-]+)/i;
2978 ($rbg)=$rattr=~/BGCOLOR\s*=\s*["']?\s*#?(\w+)/i;
2979 $rbg[$nrow]=&col2rgb($rbg);
2980 ($rdc)=$rattr=~/CHAR\s*=\s*["']?(.)/i;
2981 if($row=~/<tr/i) {$row=$`};
2982 $rh[$nrow]=$rattr=~/HEIGHT\s*=\s*["']?(\d+)/i?$1:0;
2985 while($row=~/<[tT]([hH]|[dD])(\s*[^>]*)>/g && $colsp>0) {
2988 $ctype=$1=~/h/i?1:0;
2989 if($cell=~/<t[hd]/i) {$cell=$`};
2991 $cell=~s/\)HY\($/\255/;
2992 $cell=~s/[\200-\377]([^\\]|\\20.)/$&)WB(/g if(!$latin1);
2993 ($rowsp)=$cattr=~/ROWSPAN\s*=\s*["']?(\d+)/i;
3003 ($colsp)=$cattr=~/COLSPAN\s*=\s*["']?(\d+)/i;
3008 $csp=$ncol-$icol<0? 1: $ncol-$icol+1;
3014 ($cdc)=$cattr=~/CHAR\s*=\s*["']?(.)/i;
3015 while($cells{"$nrow,$icol,0"}==1) {$icol++};
3017 for $i ($nrow..$nrow+$rsp-2) {$rd{"$i,2"}=1};
3018 for $j ($icol..$icol+$csp-1) {
3019 for $i ($nrow..$nrow+$rsp-1) {
3020 $cells{"$i,$j,0"}=1;
3024 for $j ($ncol+1..$icol+$csp) {
3026 $cells{"$i,$j,0"}=1;
3030 if($ic<$icol+$csp) {
3031 for ($ic..$icol+$csp-1) {
3032 push(@cali,$cali[$ic-1]);
3033 push(@cval,$cval[$ic-1]);
3039 $cal=$balgn-1 if($balgn);
3040 $cal=$ralgn-1 if($ralgn);
3041 $cal=$cali[$icol]-1 if($cali[$icol]);
3042 if($cattr=~/(^|\s)ALIGN\s*=\s*["']?\s*(\w+)/i) {
3043 $cal=$algn{"\L$2"}-1 if($algn{"\L$2"});
3046 $cvl=$cval[$icol] if($cval[$icol]);
3049 if($cattr=~/VALIGN\s*=\s*["']?\s*(\w+)/i) {
3050 $cvl=$v{"\L$1"} if($v{"\L$1"});
3052 ($cbg)=$cattr=~/BGCOLOR\s*=\s*["']?\s*#?(\w+)/i;
3053 $cbg=&col2rgb($cbg);
3054 for($rbg[$nrow],$tbg,$deftbg,$bg) {$cbg=$_ if(!$cbg)};
3056 $ro=$cattr=~/class\s*=\s*["']?rot(-?90)/i?$1:0;
3057 if($cattr=~/NOWRAP/i || $cal==4 || $ro) {$now=1};
3059 $dc=$bdc if($bdc || $bdc eq "0");
3060 $dc=$rdc if($rdc || $rdc eq "0");
3061 $dc=$codc[$icol] if($codc[$icol] || $codc[$icol] eq "0");
3062 $dc=$cdc if($cdc || $cdc eq "0");
3063 ($wid)=$cattr=~/WIDTH\s*=\s*["'](\d+%)/i;
3064 if($wid=~/%$/) {$wid=$`/100};
3065 if($wid>$cwid[$icol]) {$cwid[$icol]=$wid};
3066 if($cpad || $cpad eq "0") {
3083 if($rul==1 && $fra==1 && $icol==0 && $tal==0) {$clm=0};
3084 ($lang)=$cattr=~/lang\s*=\s*["']?([a-zA-Z-]+)/i;
3085 for($rla[$nrow],$tla) {$lang=$_ if(!$lang)};
3087 &inihyph if($opt_H);
3088 $cbg=~/#(\w+).*#(\w+).*#(\w+)/;
3089 &img($cell,$1,$2,$3);
3090 @cll=("{(\004$lang\004)WB($cell)}",0,0,$ctype,0,$colsp,$rowsp,$cal,
3091 "($dc)",$cvl,$now,$clm,$crm,$ctm,$cbm,0,0,0,0,$cbg,$ro);
3092 for $i (0..$#cll) {$cells{"$nrow,$icol,$i"}=$cll[$i]};
3094 if($icol-1>$ncol) {$ncol=$icol-1};
3099 if($cells{"$i,$j,0"} && $cells{"$i,$j,0"}!=1) {
3100 if($cells{"$i,$j,6"}>$nrow-$i+1) {$cells{"$i,$j,6"}=$nrow-$i+1};
3101 if($cells{"$i,$j,6"}>1) {$rd{"$i,2"}=1};
3108 $rw.="[$rh[$i] ".$rd{"$i,1"}." ".$rd{"$i,2"}." ".$rd{"$i,3"}." 0 0 [";
3111 for($rbg[$i],$tbg,$deftbg,$bg) {$cbg=$_ if(!$cbg)};
3112 $temp="[{()}0 0 0 0 1 1 0(.)0 0 $clm $crm $ctm $cbm 0 0 0 0 $cbg $ro]";
3113 if($cells{"$i,$j,0"}==1) {
3115 } elsif($cells{"$i,$j,0"}) {
3118 $temp.=$cells{"$i,$j,$k"}." ";
3126 if($nrow==$nhead+$nfoot-1) {
3130 $tdesc="[0 0 $tcl 0 0 $tal 0 $twid $bord $nrow $ncol"
3131 ." $nhead $nfoot $fra $rul {($cap)} $capa]\n";
3134 unless($wid=$cwid[$_]) {$wid=0};
3135 $cdesc.="[0 0 0 $wid $cgrp[$_] 0 0]";
3138 $tables.="[$tdesc $cdesc $rw]]\n";
3139 $_=$beg.")$ntab PT(".$rest;
3141 &img($_,$red,$grn,$blu);
3151 $'=~/(>)/ if($'!~/--\s*(--|>)/);
3159 while($l=~s/-[^-]+$// && !$lid{$l}) {};
3166 while (/<[mM][aA][tT][hH]/) {
3169 $rest=~m|</[mM][aA][tT][hH]>|;
3172 if(&math2sym($math)) {
3174 } elsif($package{'TeX'} && $package{'dvips'}) {
3175 $math=~s|\\200|\\|g;
3176 $math=~s|\\201|\(|g;
3177 $math=~s|\\202|\)|g;
3179 open(SCRATCH,">$scr.tex");
3183 `dvips -E -o $scr.ps $scr.dvi`;
3184 open(LOG,"$scr.log");
3187 ($h,$d)=$log=~/[\w\W]*$prog: +([\d.]+)pt: +([\d.]+)/ ? ($1,$2) : (1,0);
3188 $above=$h+$d>0?sprintf("%.4f",$h/($h+$d)):0;
3191 if($pic=~/^%!/ && $pic=~/%%BoundingBox: +$V +$V +$V +$V/) {
3197 for $i (split(/\n/,$pic)) {
3198 $ps.=$i."\n" if($i && $i!~/^%/);
3200 if($ps=~/\nTeXDict begin/) {
3202 $ph="/DH {1 F div dup scale /showpage {} D\n$`$&} D\n%EndDH\n";
3205 $ps="save -$llx -$lly translate\nDH$' restore";
3214 $pv.="/P$nimg {$ps} D\n";
3216 $_=$beg.")$above 3 (P$nimg) $nimg IM(".$end;
3218 $math=~s/<math$R//i;
3223 s|<[sS][uU][bB]$R|)Sb(|g;
3224 s|<[sS][uU][pP]$R|)Sp(|g;
3225 s"</[sS][uU]([bB]|[pP])>")Es("g;
3226 s|<[A-Za-z/!?]\w*$R||g;
3229 s/\004([^\004]*)\004/")".&getl($1)." Sl($&"/eg;
3231 &dbg("Inserting potential hyphenation points\n") if($opt_d && $ndoc>0);
3233 while(/\004([^\004]*)\004/) {
3237 if($end=~/\004([^\004]*)\004/) {
3245 while($htext=~/(..?)\(([^)]*)/) {
3256 } elsif($1 eq ") ") {
3262 ($txt=$2)=~s/[$ltrs]{$hyphenation{'min'},}/&hyph($&)/eg;
3270 s/\004([^\004]*)\004//g;
3275 s|&#x($X+);?|"&#".hex($1).";"|egi;
3276 for $char (keys %ent) {s/&($char)(;|$|(?=\W))/chr($ent{$char})/eg};
3277 for $char (keys %symb) {s/&($char)(;|$|(?=\W))/)SY(\\$symb{$char})ES(/g};
3278 s/&(euro|#8364)(;|$|(?=\W))/)MY(e)ES(/g;
3282 s/&($space);?/)$space{$1} Se(/g;
3283 s|&#(\d+);?|$1==38?"\005":$1<256?chr($1):$&|eg;
3284 s/(\005|&?)/\&/g;
3288 $_[0]=~s/(\\|\(;|$|(?=\W)))/\\200/g;
3289 $_[0]=~s/(\(|((;|$|(?=\W)))/\\201/g;
3290 $_[0]=~s/(\)|)(;|$|(?=\W)))/\\202/g;
3291 $_[0]=~s/&(there4|#8756|#[xX]2234)(;|$|(?=\W))/)SY(\\200)ES(/g;
3296 %a=("line","overline",
3299 "tilde","widetilde",
3300 "larr", "overleftarrow",
3301 "rarr", "overrightarrow");
3302 %b=("line","underline",
3305 "tilde","widetilde");
3306 %s=("medium","\\big",
3309 ($mattr)=/<math$R/i;
3310 $st=$mattr=~/class\s*=\s*["']?chem/i?'\rm ':'';
3311 $di=$mattr=~/class\s*=\s*["']?displayed/i?'\displaystyle ':'';
3316 s/_([^_]+)_/_{$1}/g;
3317 s/\^([^^]+)\^/^{$1}/g;
3322 s/ε?/\\varepsilon /g;
3323 s/υ?/\\upsilon /g;
3324 s/ϖ?/\\varpi /g;
3325 s/ς?/\\varsigma /g;
3326 s/ϑ?/\\vartheta /g;
3327 s/ϕ?/\\varphi /g;
3328 s/ϒ?/\\Upsilon /g;
3330 s/±?/\\pm /g;
3332 s/∧?/\\wedge /g;
3333 s/≈?/\\approx /g;
3334 s/⊆?/\\subseteq /g;
3335 s/⊂?/\\subset /g;
3336 s/⊇?/\\supseteq /g;
3337 s/⊃?/\\supset /g;
3339 s/←?/\\leftarrow /g;
3340 s/→?([_^])/\\mathop\\rightarrow\\limits$1 /g;
3341 s/→?/\\rightarrow /g;
3342 s/↑?/\\uparrow /g;
3343 s/↓?/\\downarrow /g;
3344 s/↔?/\\leftrightarrow /g;
3345 s/⇐?/\\Leftarrow /g;
3346 s/⇒?/\\Rightarrow /g;
3347 s/⇑?/\\Uparrow /g;
3348 s/⇓?/\\Downarrow /g;
3349 s/∃?/\\exists /g;
3350 s/&inf;?/\\infty /g;
3351 s/&?int;?/\\int\\limits /g;
3352 s/&?sum;?/\\sum\\limits /g;
3353 s/&?prod;?/\\prod\\limits /g;
3354 s/&pd;?/\\partial /g;
3359 s/<bt>/{\\bf\\hbox{/gi;
3362 s/<box\s*size=["']?(\w+)["']?>/{\\def\\lft{$s{$1}}\\def\\rgt{$s{$1}}/gi;
3364 s/<text\s*>/\\hbox{/gi;
3365 s/([\(\[\|])\s*<left>/\\lft$1/gi;
3366 s/<right>/\\rgt /gi;
3367 s/<(atop|choose|over)>/\\\L$1 /gi;
3369 s/<bar>/\\overline{/gi;
3370 s/<vec>/\\overrightarrow{/gi;
3371 s/<hat>/\\widehat{/gi;
3372 s/<tilde>/\\widetilde{/gi;
3373 s/<(sqrt|root|vec|dot|ddot|hat|tilde)>/\\\L$1\{/gi;
3374 while(/<above\s+sym\s*=\s*["']?equals["']?\s*>/i) {
3375 $beg=$`."\\overline{\\overline{";
3377 $rest=~s/<\/above>/}}/i;
3380 s/<above\s*>/\\overline{/gi;
3381 s/<above\s+sym\s*=\s*["']?(\w+)["']?\s*>/\\$a{$1}\{/gi;
3382 s/<below\s*>/\\underline{/gi;
3383 s/<below\s+sym\s*=\s*["']?(\w+)["']?\s*>/\\$b{$1}\{/gi;
3384 s/<\/(math|row|item|b)>//gi;
3385 s/<\/(box|t|sup|sub|sqrt|root|vec|bar|dot|ddot|hat|tilde|above|below|text|array)>/}/gi;
3389 s/&(\w+);?/\\$1 /gi;
3390 s/<array$R/\\matrix{/gi;
3391 s/<row>\s*<item$R//i;
3392 s/<row>\s*<item$R/\\cr /gi;
3396 $tex="\\batchmode\\magnification=$mag\\hsize=40cm\\nopagenumbers\n"
3397 ."\\def\\lft{\\left}\\def\\rgt{\\right}\n\\setbox0=\\hbox{\$$st$di".$_."\$}\n"
3398 ."\\immediate\\write0{$prog: \\the\\ht0: \\the\\dp0}\\box0\n\\end\n";
3402 local(@args,$_,$opt,$opts,$rest,$olist,$plist,$found,@popts);
3405 @args=split( /\|/, $optlist );
3407 if(substr($opt,-1,1) ne ':') {$olist.=$opt}
3410 @popts=split(/:/,$plist);
3411 while(@ARGV && ($_=$ARGV[0]) =~ /^-(.*)/) {
3413 if($opt=~/^-/ && $optalias{"\L$'"}) {$opt=$optalias{"\L$'"}};
3414 if($opt =~ /^[$olist]+$/) {
3415 while ($char=chop $opt) {eval "\$opt_$char=1"}
3420 for $opts (@popts) {
3421 $rest=substr($opt,length($opts));
3422 if(index($opt,$opts)==0) {
3425 if(length($rest)==0) {
3426 ++$errs unless @ARGV;
3429 eval "\$opt_$opts=\$rest";
3433 &dbg("Unknown option: $opt\n");
3442 open(STDOUT,">$opt_o") || die "*** Error opening $opt_o for output\n";
3445 if($imgcmd eq "img") {
3448 if($img=~/alt\s*=\s*"([^"]*)"/i) {$alt=$1; $match=1};
3449 if(!$match && $img=~/alt\s*=\s*([\w\.-]+)/i) {$alt=$1; $match=1};
3450 if(!$match) {$alt=")WB IA WB("};
3454 if($imgcmd eq "hr") {
3455 $text=$img=~/align\s*=\s*["']?(left|center|right)/i?")$algn{lc $1} ":")2 ";
3456 $text.=$img=~/size\s*=\s*["']?$V/i?$1:.6;
3458 if($img=~/width\s*=\s*["']?$V(%?)/i) {$wd=$2?$1/100:-$1};
3462 if($imgcmd eq "fig") {
3469 ($xs,$ys)=$pic=~/^#define.* (\d+)[\w\W]*^#define.* (\d+)/;
3470 $nd=2*int(($xs+7)/8)*$ys;
3471 ($pic)=$pic=~/[^#].* char.*[\w\W]*{([\w\W]*)}/;
3472 $pic=~s/[ ,\n\r]*0x[ ,]*//g;
3473 $pic=~y/01246789bdef/f7bd91e62480/;
3474 $bm=unpack("H*", pack("h*",$pic));
3477 pmtoraw($pm) if($pm=~/^P([1-3])/);
3480 return if(!$maptype);
3491 while($pm && $found<$nint) {
3492 if($pm=~/^\s*(\d+)/) {$num[$found]=$1};
3496 } elsif($pm=~/^\s*#.*\n/) {
3502 ($b)=$pm=~/\s([\w\W]*)/;
3503 ($xs,$ys,$bits)=@num;
3504 return if($bits>255);
3509 $bm=unpack("H*",$b);
3511 $bm=unpack("H*",$b);
3513 $nd=2*int(($xs+7)/8)*$ys;
3514 $bm=~y/0123456789abcdef/fedcba9876543210/;
3522 $temp = ord substr($pic,10,1);
3523 if($temp & 0x80) {$next += 3*2**(($temp & 0x07) + 1)} else {return};
3524 $byte = ord substr($pic,$next,1);
3525 while($byte != 0x3b && $next <= length $pic) {
3527 if(ord substr($pic,$next+1,1) == 0xf9) {
3528 if(ord substr($pic,$next+3,1) & 0x01) {
3529 &dbg("Transparent\n") if($opt_d);
3531 $idx = 3*(ord substr($pic,$next+6,1))+13;
3532 substr($pic,$idx,3) = pack("H*",$red.$grn.$blu) if($idx<length $pic);
3541 } elsif($byte == 0x2c) {
3543 $temp = ord substr($pic,$next-1,1);
3544 if($temp & 0x80) {$next += 3*2**(($temp & 0x07) + 1)};
3551 $byte = ord substr($pic,$next,1);
3554 $byte = ord substr($pic,$next,1);
3557 $byte = ord substr($pic,$next,1);
3560 &dbg("@_\n") if($opt_d);
3565 &dbg("Retrieving $url");
3566 if($package{'libwww-perl'} || $package{'jfriedl'}) {
3570 &prompt("\nDocument requires username and password\n\nUsername: ",$user);
3571 &prompt("Password: ",$pass);
3575 } elsif(defined $geturl) {
3577 $_[1]=`$geturl '$url'`;
3579 &dbg("\n*** Error opening $url\n");
3583 if($_[1]=~/\r?\n\r?\n/) {
3586 ($code)=$dhead=~/HTTP\/\S+ +(\d+)/i;
3587 ($contyp)=$dhead=~/Content-type:\s+(.*)/i;
3596 if($package{'libwww-perl'}) {
3597 require LWP::UserAgent;
3598 $ua=new LWP::UserAgent;
3601 require HTTP::Cookies;
3602 $cookie_jar = HTTP::Cookies::Netscape->new(File => $opt_k, AutoSave => 1);
3603 $ua->cookie_jar($cookie_jar);
3605 $req = HTTP::Request->new(GET => $url);
3606 $req->authorization_basic(@_) if(@_);
3607 $ua->agent($spoof) if($spoof);
3608 my $res = $ua->request($req);
3610 $contyp=$res->header('content-type');
3611 $cont=$res->content;
3614 @opts=@_?("authorization=$_[0]:$_[1]"):();
3615 push(@opts,"quiet") if(!$opt_d);
3616 $www::useragent=$spoof if($spoof);
3617 ($status,$memo,%info)=&www::open_http_url(*FILE,$url,@opts);
3618 $code=$info{'CODE'};
3619 ($contyp)=$info{'HEADER'}=~/Content-type:\s+(.*)/i;
3633 ($type)=$URL=~/([^\?]+)\??/;
3634 ($type)=$type=~/\.(\w+)$/;
3638 if($opt_U && $src{$URL} && !$cmd{$URL.$red.$grn.$blu}) {
3640 } elsif($URL=~m|://|) {
3641 &geturl($URL,$pic) || return;
3646 unless($orig=~s/\.\w*$/.ps/) {$orig.=".ps"};
3647 if(open(ORIG,"$orig")) {
3650 if($pic=~/^%!/ && $pic=~/%%BoundingBox:/) {
3652 &dbg("Using $orig as original for $URL\n") if($opt_d);
3657 if(open(PIC,"$URL")) {
3662 &dbg("*** Error opening $URL\n");
3668 &trans if($pic=~/^GIF/);
3669 if($pic=~/^P[1-6]/) {
3672 open(SCRATCH,">$scr");
3674 print SCRATCH "$pic";
3676 if($pic=~/^%!/ && $pic=~/%%BoundingBox: +$V +$V +$V +$V/) {
3679 $ps="save\n0 0 M\nIS IS scale\n/showpage {}D\n".(0-$1)." ".(0-$2)." translate\n";
3680 for $i (split(/\n/,$pic)) {
3681 $ps.=$i."\n" if($i && $i!~/^%/);
3684 } elsif($type=~/.xbm$/i || $pic=~/^#define/) {
3686 } elsif($package{'ImageMagick'}) {
3687 if($package{'PerlMagick'}) {
3688 $imobj=Image::Magick->new;
3689 $mess=$imobj->Read($scr);
3693 $mess=$imobj->Write("$scr\.$pg1");
3694 &dbg("$mess\n") if($mess);
3698 # &run("convert $scr $pg1:-");
3699 &run("convert $scr $scr\.$pg1");
3701 open(PNM,"$scr\.$pg1");
3705 if(!$pm && $pic=~/^\377\330/ && $package{'djpeg'}) {
3706 &run("djpeg $scr$pg2");
3708 } elsif($pic=~/^\377\330/ && $package{'djpeg'}) {
3709 &run("djpeg $scr$pg2");
3710 } elsif($package{'pbmplus'} || $package{'netpbm'}) {
3712 &run("$giftopm $scr");
3714 &run("anytopnm $scr");
3716 if($opt_g && $pm=~/^P6/) {
3717 open(SCRATCH,">$scr");
3721 &run("ppmtopgm $scr");
3727 $bm=substr($bm,0,$nd);
3728 $pad=$nd-length($bm);
3729 if($pad) {$bm.="f" x $pad};
3730 $bm=~s/(.{60})/$1\n/g;
3735 for $char (keys %symb) {s/&($char)(;|$|(?=\W))/\\$symb{$char}/g};
3736 $stat=!/([&<][a-zA-Z]|[_^{])/;
3737 s/[a-zA-Z\s]*[a-zA-Z][a-zA-Z\s]*/)ES()I($&)ES()SY(/g;
3738 s/(\\200|\\201|\\202)/)RO($&)ES(/g;
3745 s/\([^)]+\)/()$&join /g;
3746 s/(^|[^\\])\$(T|N|U|H|A)/$1)join $vars{$2} join(/g;
3747 s/(^|[^\\])\$D\{"(.*?)"\}/"$1".POSIX::strftime($+,@now)/eg if($posix);
3748 s/(^|[^\\])\$D/"$1".POSIX::strftime($datefmt,@now)/eg if($posix);
3749 # while(/(?=[^\\])\${([^}]+)}/) {
3750 while(/(?=[^\\])\$\[([^]]+)\]/) {
3751 if(!defined $metarc{lc $1}) {
3752 $metarc{lc $1}=$mn++;
3754 $_="$`)join ME $metarc{lc $1} get join($'";
3759 s/\(\) ?(\([^)]*\)|\w+) ?join/ $1/g;
3763 return 0 if(!$opt_W);
3764 $H=$lnk=~/\.html?(#|$)/i || $lnk=~m|.+//.+/[^/\.]*$|;
3765 $T=$rev && ($revtoc && $ndoc==1 || $ndoc>1 && $H);
3766 $L=$b1=~m|://| && $lnk=~m"^$b1(/|$)" || $b1!~m|://| && $lnk!~m|://|;
3767 $B=$B2 && $lnk=~/^$B2/ || !$B2 && $lnk!~m"(^\.\.|://)";
3768 return $rlnk && ($H || $T) if($rel);
3769 return $L && ($H || $T) if($local);
3770 return $B && ($H || $T) if($below);
3771 return $H || $T if($rev);
3775 &dbg("Generating DSC PostScript\n") if($opt_d);
3776 %op=("moveto",2, "rmoveto",2, "lineto",2, "rlineto",2, "translate",2,
3777 "scale",2, "show",1, "awidthshow",6, "stroke",0, "save",0, "restore",0,
3778 "gsave",0, "grestore",0, "showpage",0, "newpath",0, "setlinewidth",1,
3779 "setlinejoin",1, "setgray",1, "closepath",0, "fill",0, "arc",5,
3780 "setrgbcolor",3, "rotate",1, "image",5, "colorimage",7);
3781 %sho=("moveto","M", "rmoveto","RM", "lineto","L", "rlineto","RL", "show","S",
3782 "showpage","N", "awidthshow","A");
3786 $cmd=$sho{$_}?$sho{$_}:$_;
3791 if(/showpage/) {$extra="Bb{Xl Yl Xh Yh}if Pn "};
3792 if(/image/) {$extra="K ";$j++};
3793 $t=$op{$_}?"$op{$_} copy $extra$in{$_} $j array astore":"[$extra$in{$_}]";
3794 $po.="/$_ {OU {$t ==} if $_}d\n";
3796 $po.="/pdfmark {$i] ==} D\n";
3797 $in{"pdfmark"}=$i++;
3798 push(@val,"pdfmark");
3799 $po.="/NF {OU{2 copy E $i 3 array astore ==}if ONF}d\n"
3800 ."/EX {[IS EC] ==} D\n/Cd {} D\n/DU {TU PM 1 eq and TP and{Pn ==}if}d\n"
3801 ."/BB {US Bb{dup Yl lt{dup /Yl E D}if dup Yh gt{/Yh E D}{pop}ie\n"
3802 ." dup Xl lt{dup /Xl E D}if dup Xh gt{/Xh E D}{pop}ie}\n"
3803 ." {/Yl E D /Yh Yl D /Xl E D /Xh Xl D /Bb t D}ie}D\n";
3809 ($ti)=/%%Title: (.*)/;
3812 for $vec ("IT","WS") {
3814 @$vec=split(' ',$1);
3822 ($epsf)=/(\n\/P\d+_?\d* [\w\W]*)%Endpv/;
3823 while($epsf=~/\n\/(P\d+_?\d*) \{/g) {
3826 $temp=$'=~/\/P\d+_?\d* \{/?$`:$rest;
3827 ($eps{$pid})=$temp=~/([\w\W]*)} D/;
3836 $j++ if($IT[$i] == 0);
3839 $dfn="/F $opt_s D\n$ph";
3841 $dfn.="/$sho{$_} {$_} d\n";
3844 open(SCR,">$scr.ps");
3845 print SCR "$_ quit\n";
3848 $io="($in{'image'}|$in{'colorimage'})";
3853 $EPS="%%EndPageSetup";
3857 for $line (split(/\r?\n/,`$gs -q -dNODISPLAY $scr.ps -c quit`)) {
3863 if($start && $line!~/ $in{"pdfmark"}\]$/) {
3868 $pp=$line=~/^\[(\S+) (\S+) ($in{'moveto'}|$in{'rmoveto'}|$in{'Nf'})\]$/;
3870 if($pp && $3==$in{"Nf"}) {
3871 $fn="$1 $2 $val[$3]\n";
3874 if($pp && $3==$in{"moveto"}) {
3877 $mv=sprintf("%.1f %.1f %s\n",$1,$2,$val[$3]);
3880 if($pp && $3==$in{"rmoveto"}) {
3884 $mv=sprintf("%.1f %.1f %s\n",$cx,$cy,$val[$in{"moveto"}]);
3886 $temp.=sprintf("%.1f %.1f %s\n",$1,$2,$val[$3]) if($1||$2);
3890 if($line=~s/^\[(.*)\((\S*)\) ($in{"showpage"})\]$/pgsave restore $val[$3]/) {
3893 ($llx,$lly,$urx,$ury)=split(/ /,$1);
3898 $pbb="%%PageBoundingBox: $llx $lly $urx $ury\n";
3899 if(!defined($Llx) || $llx<$Llx) {$Llx=$llx};
3900 if(!defined($Lly) || $lly<$Lly) {$Lly=$lly};
3901 if(!defined($Urx) || $urx>$Urx) {$Urx=$urx};
3902 if(!defined($Ury) || $ury>$Ury) {$Ury=$ury};
3904 $pn.="," if($pn && $2);
3907 for(0..$#docfonts) {
3908 push(@df,$docfonts[$_]) if($uf{$_}==$n);
3910 push(@df,"Symbol") if($uf{"-1"}==$n);
3912 $tmp=@df?"%%PageResources: font":"";
3914 $_.="%%Page: $pn$2 $n\n$fu$pbb%%BeginPageSetup\n/pgsave save D\n$temp$line\n";
3915 $EPS="%%EndPageSetup";
3923 if($line=~/^\[([^(]*)(\(.*\)) ($in{"show"}|$in{"awidthshow"})\]$/) {
3925 $line="$fn$1$2 $val[$3]";
3926 if($fn=~/(\S+) Nf/ && $uf{$1}!=$n+1) {
3928 $fnt=$1<0?"Symbol":$docfonts[$1];
3929 $line="%%IncludeResource: font $fnt\n$line";
3938 if($line=~/^\[(\S+) (\S+) ($in{"scale"})\]$/) {
3939 $line=$1!=1||$2!=1?"$1 $2 $val[$3]\n$EPS":"$EPS";
3943 if($line=~/^\[(.*) (\d+) $io\]$/) {
3944 $li=$BM[$2]=~y/\n/\n/+2;
3945 $line="\/picstr $WS[$ix[$2]] string D\n$1\n"
3946 ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$2]\n%%EndData";
3949 if($line=~/^\((.*)\)$/) {
3954 last S if($line=~s/^\[([^\/].* )?(\d+)\]$/$1$val[$2]/);
3955 last S if($line=~s/(\)\])? (\/\w+) $in{"pdfmark"}\]$/$1 $cd{$1}$2 pdfmark/);
3956 last S if($line=~s/^\[(\S+) \((P\d+.*)\)\]$/\/IS $1 D\n$eps{$2}/);
3959 if(!$pp && $mv.$line) {
3961 $temp.="$mv$line\n";
3967 for(0..$#docfonts) {
3968 $ff=$ff{$docfonts[$_]};
3969 if($ff && $uf{$_}>0) {
3970 push(@sf,$docfonts[$_]);
3971 $fontdef.="%%BeginResource: font $docfonts[$_]\n$cont{$ff}\n%%EndResource\n";
3974 push(@nf,$docfonts[$_]) if(!$ff && $uf{$_}>0);
3976 push(@nf,"Symbol") if($uf{"-1"}>0);
3977 $ti="@ARGV" unless($psin);
3978 $or=$opt_L?"Landscape":"Portrait";
3979 $setup="%%BeginSetup\n";
3980 $setup.="$dupl\n" if($dupl);
3981 $setup.="$fontdef" if($fontdef);
3983 $tmp=@nf?"%%DocumentNeededResources: font":"";
3985 $tmp=@sf?"%%DocumentSuppliedResources: font":"";
3987 s/\\(200|201|202)/\\$ssy{$1}/g;
3989 $dd="Clean8Bit" if(($fontdef.$_)=~/[\200-\377]/);
3990 $dd="Binary" if(($fontdef.$_)=~/[\000-\010\013-\014\016-\036]/);
3996 %%CreationDate: $time
3997 $fu%%DocumentData: $dd
3999 %%BoundingBox: $Llx $Lly $Urx $Ury
4003 /d {bind def} bind def
4012 $mysymb/Nf {dup 0 ge{FL E get}{-1 eq{/Symbol}{/MySymbol}ie}ie findfont
4013 E scalefont setfont} D
4014 /IP {currentfile picstr readhexstring pop} D
4017 $setup$reenc$pdf%%EndSetup
4023 if(length($tmp.$_)>78) {
4029 $fu.="$tmp\n" if($tmp);
4034 open(SCR,">$scr.ps");
4035 print SCR "$`HN{==}forall $& quit\n";
4037 $pnum=`$gs -q -dNODISPLAY $scr.ps -c quit`;
4038 while($pnum=~/\([^)]*\)/g) {push(@pnum,$&)};
4041 s|/HN [^D]*D|/HN [$pnum] D|;
4044 $_[0]=~s/(.{70}[^ \n]*) ([^ ])/$1\n$2/g;
4056 unlink "$scr","$scr.ps","$scr.ppm","$scr.tex","$scr.dvi","$scr.log" if($scr);
4060 $rgb=$colour{"\L$_[0]"}?($colour{"\L$_[0]"}):$_[0];
4061 @cvec=$rgb=~/($X$X)($X$X)($X$X)/?($1,$2,$3):();
4062 @cvec?"[16#$1 16#$2 16#$3]":"";
4065 if($hyphenation_file{$lang}) {
4066 $hyfile=$hyphenation_file{$lang};
4068 &dbg("No hyphenation file for language '$lang'\n");
4070 while($lng=~s/-?[^-]+$// && !$hyphenation_file{$lng}) {};
4071 $hyfile=$hyphenation_file{$lng};
4072 &dbg(" ..using $hyfile\n");
4074 if($init{$hyfile}) {
4075 $rep{$lang}=$refl{$hyfile};
4078 if(open(HYPH,$hyfile)) {
4079 &dbg("Reading hyphenation patterns from $hyfile\n") if($opt_d);
4080 <HYPH>=~/\\patterns{.*/;
4083 ($patterns=$')=~s/\^\^($X$X)/chr hex $1/eg;
4086 while ($def=~/\\lccode(`\\?\^\^|")($X$X)=(`\\?\^\^|")($X$X)/g) {
4090 if($`=~/\n$/ || $`!~/%.*$/) {
4091 $upp{$lang}.=chr hex $uc;
4092 $low{$lang}.=chr hex $lc;
4096 while ($def=~/\\let\\(\w+)=(\^\^|")($X$X)/g) {
4099 $tex{$key}=$value if($`=~/\n$/ || $`!~/%.*$/);
4101 for $key (keys %tex) {
4102 $patterns=~s/\\$key */$tex{$key}/g;
4105 %de=('"a',228, '"o',246, '"u',252, '\3', 223);
4106 $patterns=~s/\\c\{[^}]*\}//g;
4107 $patterns=~s/\\n\{([^}]*)\}/$1/g;
4108 $patterns=~s/("a|"o|"u|\\3)/chr $de{$1}/eg;
4109 $upp{"de"}=~s/\337//;
4110 $low{"de"}=~s/\377//;
4112 if($lang=~/^is/ && !$upp{"is"}) {
4113 %is=("'a","\341", "'e","\351", "'i","\355", "'o","\363", "'u","\372",
4114 "'y","\375", '"x',"\346", '"o',"\366", "'d","\360", "`t","\376");
4115 $isch=join("|",keys %is);
4116 $patterns=~s/($isch)/$is{$1}/g;
4117 $upp{"is"}="\301\311\315\323\332\335\306\326\336\320";
4118 $low{"is"}="\341\351\355\363\372\375\346\366\376\360";
4120 if($lang=~/^fi/ && !$upp{"fi"}) {
4121 $upp{"fi"}="\304\326";
4122 $low{"fi"}="\344\366";
4124 if($lang=~/^fr/ && !$upp{"fr"}) {
4125 $upp{"fr"}="\300\302\307\311\310\312\313\316\317\324\326\333\226";
4126 $low{"fr"}="\340\342\347\351\350\352\353\356\357\364\366\373\225";
4128 if($lang=~/^es/ && !$upp{"es"}) {
4129 $upp{"es"}="\301\311\315\323\321\332\334";
4130 $low{"es"}="\341\351\355\363\361\372\374";
4132 $patterns=~s/\{([\w\W]*?)\}/[$1]/g;
4135 if($def.$'=~/\\hyphenation\[.*/) {
4139 ($patterns=$end)=~s/%.*//g;
4140 for $key (split('\s+',$patterns)) {
4143 $value=~s/^([$ltrs.])/0$1/;
4144 $value=~s/[$ltrs](\d)/$1/g;
4145 $value=~s/[$ltrs.]/0/g;
4146 $patt{"$key,$lang"}=$value if($value=~/^\d+$/);
4149 &dbg("Cannot open hyphenation file: $hyfile\n");
4151 $hext=$hyphenation_extfile{$lang};
4152 for(split('\s*:\s*',$hext)) {
4154 &dbg("Reading hyphenation extensions from $_\n") if($opt_d);
4158 &dbg("Cannot open hyphenation extension file: $_\n");
4162 for $key (keys %tex) {
4163 $hyext=~s/$key */$tex{$key}/g;
4165 for $key (split('\s+',$hyext)) {
4169 $value=~s/[$ltrs]/0/g;
4171 $hext{"$key,$lang"}=$value;
4174 $refl{$hyfile}=$lang;
4180 eval "\$word=~y/$upp{$rep{$lang}}/$low{$rep{$lang}}/" if($upp{$rep{$lang}});
4182 $h=$hext{"$word,$rep{$lang}"};
4188 for $j (0..$len-$i) {
4189 $str=substr(".$word.",$j,$i+2);
4190 $pstr=$patt{"$str,$rep{$lang}"};
4192 @patt=split(//,$pstr);
4193 for $k (0..$#patt) {
4194 $br[$k+$j]=$patt[$k] if($br[$k+$j]<$patt[$k]);
4201 for $i (0..$len-1) {
4202 $hword.=substr($_[0],$i,1);
4203 if(($h || $i>$hyphenation{'start'}-2 && $i<$len-$hyphenation{'end'})
4204 && $br[$i+2]%2==1) {$hword.=")HY("};
4206 $hword.=")YH(" if(length $word < length $hword);
4213 push(@font,$fontid{"\L$font"});
4215 push(@size,$arr{'font-size'});
4216 push(@alig,$algn{$arr{'text-align'}}-1);
4217 push(@topm,$arr{'margin-top'});
4218 push(@botm,$arr{'margin-bottom'});
4219 push(@lftm,$arr{'margin-left'});
4220 push(@rgtm,$arr{'margin-right'});
4221 push(@colr,$col eq "[16#00 16#00 16#00]"?0:$col);
4222 $temp=$arr{'margin-top'}*$arr{'font-size'};
4223 $mi=$temp if($temp>$mi);
4224 $temp=$arr{'margin-bottom'}*$arr{'font-size'};
4225 $mi=$temp if($temp>$mi);
4228 $arr{'font-family'}='times' if($el ne 'p' && !$latin1 && !defined $arr{$_});
4229 for ("font-family","font-size") {
4230 $arr{$_}=$body{$_} if(!defined $arr{$_});
4232 ($font=$arr{'font-family'})=~s/\W/-/g;
4233 if(!$font_names{"\L$font"}) {$font=$fal{$font}};
4234 if(!$font_names{"\L$font"}) {
4235 &dbg("Unknown font: $arr{'font-family'}, using $deffnt{$_[0]}\n");
4236 $font=$deffnt{$_[0]};
4238 if(!defined $fontid{"\L$font"}) {
4239 $fontid{"\L$font"}=$nfont++;
4240 @names=split(/\s+/,$font_names{"\L$font"});
4241 for($#names+1..3) {push(@names,$names[0])};
4242 @docfonts=(@docfonts,@names);
4244 &getval($arr{"font-size"},2);
4245 for ('left','right','top','bottom') {
4246 $arr{"margin-$_"}=0 if(!defined $arr{"margin-$_"});
4248 for ($arr{"text-indent"},$arr{"margin-top"},$arr{"margin-bottom"},
4249 $arr{"margin-left"},$arr{"margin-right"}) {
4252 $styl=$arr{'font-style'}=~/^(i|o)/+2*($arr{'font-weight'}=~/^b/);
4253 $col=$arr{'color'}?&col2rgb($arr{'color'}):-1;
4256 local($_,$red,$grn,$blu)=@_;
4258 ($red,$grn,$blu)=("FF","FF","FF") if(!$opt_U);
4259 while (/<(img|fig|hr|overlay|object)\s/i) {
4266 if($imgcmd ne "object" || $img=~/data\s*=\s*['"]?([\w\/\.:~%-]+\.$IM)/i
4267 || $img=~/type\s*=\s*['"]?(image\/|application\/postscript)/i){
4273 ($align)=$img=~/align\s*=\s*['"]?(\w*)/i;
4274 if($align=~/^middle$/i) {$al=1};
4275 if($align=~/^top$/i) {$al=2};
4276 if($imgcmd eq "overlay") {
4280 if($img=~/\s*x\s*=\s*['"]?(\d+)/i) {$xoff=$1};
4281 if($img=~/\s*y\s*=\s*['"]?(\d+)/i) {$yoff=$1};
4282 $off="$xoff $yoff ";
4285 if($img=~/\s(src|data)\s*=\s*($S)/i) {($url)=$+=~/([^ \n]*)/};
4286 &dbg("Image: $url\n") if($opt_d && $url);
4288 unless($url=~m|://|) {
4290 if($url=~m|^/|) {$URL=$b1.$url} else {$URL=$b2.$url}
4292 while($URL!~m|^\.\./| && $URL=~m|[^/]*/\.\./|) {$URL=$`.$'};
4294 $text=$src{$URL}?$cmd{$URL.$red.$grn.$blu}:$cmd{$URL};
4295 if(!$text || $opt_U && $src{$URL} && !$cmd{$URL.$red.$grn.$blu}) {
4296 if(!$url || $failed{$url}) {
4301 &dbg("Size: $xs*$ys\n") if($opt_d);
4309 push(@WS,int(($xs-1)*$dp/8)+1);
4320 $npr=$ps=~s|(.*\n){$nli}|sprintf("$&} D\n/P$nimg\_%d {",$n++)|eg;
4324 $proc.="P$nimg\_$i ";
4327 $pv.="/P$nimg\_0 {$ps} D\n";
4328 $eps{"P$nimg\_0"}=$ps;
4331 $pv.="/P$nimg {$ps} D\n";
4335 $text="$proc $nimg IM(";
4336 $cmd{$URL}=$text if(!$cmd{$URL});
4337 $cmd{$URL.$red.$grn.$blu}=$text if($src{$URL});
4339 $end=$' if($imgcmd eq "object" && $end=~m|</object>|i);
4345 } elsif($imgcmd eq "object" && $end=~m|</object>|i) {
4350 $text=")".$off.$al.$text;
4351 if($imgcmd eq "fig") {
4356 while($fig=~/(<overlay$R)/ig) {$over.=$1};
4357 ($dum,$cap)=$fig=~m|<caption$R([\w\W]*)</caption>|i;
4358 ($dum,$cred)=$fig=~m|<credit$R([\w\W]*)</credit>|i;
4359 $text=")BN($text$over)BN($cap)BN($cred)BN(";
4365 s|<[hH][rR]$R|)2 1 1 HR(|g;
4369 local($val,$unit)=$_[0]=~/$V\s*(\w*)/g;
4370 $val*=$cm{$unit} if($_[1]==1 && defined $cm{$unit});
4371 $val*=$pt{$unit} if($_[1]==2 && defined $pt{$unit});
4376 while(/\@import\s+(([\w.\/-]+)|"([^"]*)"|'([^']*)')\s*;/) {
4377 if(open(SS,$+) && !$read{$+}) {
4380 print DBG "***** $+:\n$conf" if($opt_d);
4384 &dbg($read{$+}?"Infinite \@import loop: $+\n":"Error opening: $+\n");
4389 while(&getblk($_)){};
4393 local ($beg,$match,$end,$blk,$key,$val,$id,$temp);
4401 ($id=$&)=~s/^\s*|\s*\{//g;
4403 push(@block,"\L$id");
4405 $valid{$id}=1 if(!$user);
4406 if($id eq "color") {$id="colour"};
4408 &dbg("Error in configuration file: unknown block name '$id'\n");
4412 W:while(/\s*(\/\*|[\w][\w-]*\s*:|[\w,:.\s-]+\{|\})\s*/) {
4413 $blk.=$1 if($1 ne "/*");
4420 $blk.=&getblk($temp);
4425 ($key=$`)=~s/\s*$//;
4426 # $end=~/([\w.\$-]+|"[^"]*"|'[^']*')\s*;?/;
4427 $end=~/("[^"]*"|'[^']*'|.*?(?= *(\/\*|;|}|$)))/m;
4430 ($val=$1)=~s/^["']|["']$//g;
4431 $val=~s/'|\\/\\$&/g;
4433 $typ=2 if($val=~/^$V(cm|mm|in|pt|pc|em)$/);
4434 $typ=3 if($val=~/^$V$/);
4435 $typ=4 if($val=~/^-?\d+$/);
4436 $typ=5 if($val eq "0" || $val eq "1");
4437 if($block[0] eq '@html2ps') {
4441 $type{$key}=$typ if(!defined $type{$key});
4444 if($typ>=$type{$key}) {
4446 eval "\$$key='$val'" if($user || $val ne '');
4447 # print DBG "\$$key='$val'\n" if($opt_d && $user);
4449 &dbg("Error in configuration file: bad value for $key: $val\n");
4452 &dbg("Error in configuration file: unknown key '$key'\n");
4456 if($id eq "option" && $optalias{$key}) {$key=$optalias{$key}};
4458 $valid{"$id,$key"}=1;
4459 $type{"$id,$key"}=$typ if(!defined $type{"$id,$key"});
4461 if($valid{"$id,$key"} || $extend{$id}) {
4462 if($typ>=$type{"$id,$key"} || $id eq "colour") {
4463 eval "\$$id\{'$key'}='$val'" if($user || $val ne '');
4464 # print DBG "\$$id\{'$key'}='$val'\n" if($opt_d && $user);
4466 &dbg("Error in configuration file: bad value for $key: $val\n");
4469 &dbg("Error in block '$id' in configuration file:"
4470 ." unknown key '$key'\n");
4474 $temp="$block[$#block-1]_$key";
4475 $valid{$temp}=1 if(!$user);
4476 $parblk=$block[$#block-1];
4478 eval "\$$parblk\_$key\{'$id'}='$val'";
4479 # print DBG "\$$parblk\_$key\{'$id'}='$val'\n" if($opt_d && $user);
4480 } elsif($valid{$parblk}) {
4481 &dbg("Error in block '$parblk' in configuration file:"
4482 ." unknown key '$key'\n");
4486 for $i (split(',\s*',$id)) {
4490 eval "\$$i\{'\L$key'}='\L$val'";
4491 # print DBG "\$$i\{'\L$key'}='\L$val'\n" if($opt_d && $user);
4496 if($match eq "/*") {
4511 chop($_[1]=<STDIN>);
4519 local($head,$body,$beg,$end,$match,$tag);
4520 #If neither </HEAD> nor <BODY> can be found, find the separation point (messy).
4521 if(!/<(body|\/head)/i || $`=~/<plaintext|<xmp|<listing|<!--/i) {
4524 S1: while(/<(\/?\w+|!--|!|\?)/) {
4539 $int.="$beg$match$`>";
4544 last S1 if(!$head{"\L$tag"});
4546 $head.=$int.$beg.$match.$&;
4561 &geturl($_[0],$_[1]);
4562 } elsif(open(FILE,$_[0])) {
4570 for $margin ('left','right','top','bottom') {
4571 ($m)=$margin=~/(.)/;
4572 if(defined $margin{$margin}) {
4573 &dbg("'margin { margin-$margin:... }' is obsolete, use '\@page'\n");
4574 $AT_page{"margin-$margin"}=$margin{$margin} if(!defined $AT_page{"margin-$margin"});
4576 for $page ('left','right') {
4578 eval "\$m$m$p=\$AT_page\{'margin'} if(defined \$AT_page\{'margin'})";
4579 eval "\$m$m$p=\$AT_page\{'margin-$margin'} if(defined \$AT_page\{'margin-$margin'})";
4580 eval "\$m$m$p=\$AT_page__$page\{'margin'} if(defined \$AT_page__$page\{'margin'})";
4581 eval "\$m$m$p=\$AT_page__$page\{'margin-$margin'} if(defined \$AT_page__$page\{'margin-$margin'})";
4589 1 while ($temp=~s/^\s*#.*//);
4590 next if($pars[0] eq 'P1' && $i == 3);
4591 $temp=~s/\s*(\S+)\s*//;
4595 $pars[0]=~s/\d/$&+3/e;
4596 $_[0]="$pars[0]\n$pars[1] $pars[2]\n";
4597 if($pars[0] eq 'P4') {
4599 $_[0].=pack("B*",$temp);
4602 while ($temp=~/\d+/g) {
4603 $_[0].=pack("C",int(255*$&/$pars[3]+.5));