6 0 obj << /Length 4634 >> stream BT /F1 10 Tf 11.5 TL 72 556 Td (This is pdf, done the cool way, acrobat is for \ weanies!!! ) Tj T* (This is by far the best way to know what you are going to get. www.perlmonks.org rules!) Tj ET 178 520 m 407 520 l .8 w S #Stroking the line to underline above url #### print scalar <>; while (!eof(ARGV)) { $pos = tell(ARGV); $line = scalar <>; my ($Obj) = $line =~ /^(\d+) \d+ obj/; $xref[$Obj - 1] = $pos if defined $Obj; $Str{$#xref + 1}->[0] = tell(ARGV) if $line =~ /^stream/; $Str{$#xref + 1}->[1] = $pos if $line =~ /^endstream/; print $line; } $pos = tell; print "xref\n0 ", scalar @xref + 1, "\n"; printf "%010d 65535 f \n", 0; foreach $entry (@xref) { printf "%010d 00000 n \n", $entry; } print "trailer\n<< /Size ", scalar @xref + 1, " /Root 1 0 R /Info 8 0 R >>\n"; print "startxref\n$pos\n%%EOF\n"; for my $Key (sort {$a <=> $b} keys %Str){ warn "Stream in $Key ", "begins: $Str{$Key}->[0] ", "ends: $Str{$Key}->[1] ", "length: @{[$Str{$Key}->[1] - $Str{$Key}->[0]]}\n"; }