diff -ru PDFJ-0.90/PDFJ.pm PDFJ-0.90ch/PDFJ.pm --- PDFJ-0.90/PDFJ.pm 2006-10-22 19:27:42.000000000 +0900 +++ PDFJ-0.90ch/PDFJ.pm 2009-01-13 23:35:21.000000000 +0900 @@ -3057,16 +3057,6 @@ $self->{hyphened} = 0; } -my %TextLineIndex = ( - Start => 1, - Count => 2, - Shift => 3, - FixedGlues => 4, - PreAOLS => 5, - PostAOLS => 6, - PreSkip => 7, -); - sub _fold { my($self, $paraobj) = @_; my $chunks = $self->chunks; @@ -3200,9 +3190,16 @@ } else { $preskip = $lineskip; } - push @lines, - [\%TextLineIndex, $start, $count, $shift, $fixedglues, $preaols, - $postaols, $preskip]; + my %hash =( + Start => $start , + Count => $count , + Shift => $shift , + FixedGlues => $fixedglues , + PreAOLS => $preaols , + PostAOLS => $postaols, + PreSkip => $preskip , + ); + push(@lines,\%hash); $start = $nextpos; } @lines; @@ -3216,7 +3213,7 @@ my($can, $canleft, $pre, $word); if( $string =~ /([A-Za-z]-)([A-Za-z])/ ) { $can = $`.$1; - $canleft = $2.$'; + $canleft = $2.$'; #' } elsif( $string =~ /[A-Za-z]{5,}/ ) { $pre = $`; $word = $&; @@ -4301,29 +4298,30 @@ # chunk array index my %ChunkIndex = ( - Style => 1, # PDFJ::TextStyle object - Mode => 2, # description as above - Class => 3, # description as above - Splittable => 4, # 1 for splittable at pre-postion - Glue => 5, # normal glue width - GlueDec => 6, # decrease adjustable glue width - GlueInc => 7, # increase adjustable glue width - GluePref => 8, # glue preference - Count => 9, # characters count - String => 10, # characters string - PreShift => 11, # postion shift at pre-postion - PostShift => 12, # postion shift at post-postion - GlueFix => 13, # fixed glue (to be calculated) - Hyphened => 14, # 1 for splitted, 2 for hyphened - RubyText => 15, # ruby PDFJ::Text object - AltObj => 16, # alternative object for String - RubyOverlap => 17, # ruby overlap size + Style => 0, # PDFJ::TextStyle object + Mode => 1, # description as above + Class => 2, # description as above + Splittable => 3, # 1 for splittable at pre-postion + Glue => 4, # normal glue width + GlueDec => 5, # decrease adjustable glue width + GlueInc => 6, # increase adjustable glue width + GluePref => 7, # glue preference + Count => 8, # characters count + String => 9, # characters string + PreShift => 10, # postion shift at pre-postion + PostShift => 11, # postion shift at post-postion + GlueFix => 12, # fixed glue (to be calculated) + Hyphened => 13, # 1 for splitted, 2 for hyphened + RubyText => 14, # ruby PDFJ::Text object + AltObj => 15, # alternative object for String + RubyOverlap => 16, # ruby overlap size ); sub new { my($class, @args) = @_; - unshift @args, \%ChunkIndex; - bless \@args, $class; + my %hash = map { $_ => $args[ $ChunkIndex{ $_ } ] } keys(%ChunkIndex) ; + + bless \%hash, $class; } sub clone { diff -ru PDFJ-0.90/XPDFJ.pm PDFJ-0.90ch/XPDFJ.pm --- PDFJ-0.90/XPDFJ.pm 2006-02-09 09:55:38.000000000 +0900 +++ PDFJ-0.90ch/XPDFJ.pm 2009-01-13 23:35:15.000000000 +0900 @@ -23,7 +23,7 @@ sub new { my($class, %args) = @_; my $safe = new Safe; - $safe->permit_only(qw(:default :base_math sort)); + $safe->permit_only(qw(:default :base_math sort print require)); $safe->share(qw(type)); $safe->share(qw($bytesimport)) if $] > 5.007; my %Args;