OSDN Git Service

BugTrack-wiki/320
authortakezoe <takezoe@users.osdn.me>
Sat, 2 Oct 2010 01:44:23 +0000 (01:44 +0000)
committertakezoe <takezoe@users.osdn.me>
Sat, 2 Oct 2010 01:44:23 +0000 (01:44 +0000)
plugin/pdf/PDFParser.pm

index 4e61328..6cbb3ac 100644 (file)
@@ -120,7 +120,14 @@ sub get_texts {
        my $texts = "";
        foreach my $textobj (@$obj){
                foreach(@{$textobj->{texts}}){
-                       $texts .= $_;
+                       if(ref($_) eq 'PDFJ::Text'){\r
+                               my $obj2; push @$obj2,$_;\r
+                               $texts .= $self->get_texts($obj2);\r
+                       } elsif(ref($_) ne ''){\r
+                               next;\r
+                       } else {
+                               $texts .= $_;
+                       }
                }
        }
        return $texts;