All pastes #145363 Raw Edit

Anonymous

public text v1 · immutable
#145363 ·published 2006-08-22 23:14 UTC
rendered paste body
sub get_text {
        my @a = split /\./,"$_[0]";
        $type = $filetypes{"$a[1]"};
        unless ($type) {
                $type = 'null';
        }
        #my $target = "$_[1].$type";
        #scp from remote $_[0] to $target
        my $target=$_[0];
        my $return = '';
        if ($type eq 'pdf') {
                #system("pstotext $target $tempfile");
                exec("/usr/local/bin/pdftotext $target $tempfile");
                open(INFILE, "$tempfile");
                @text=<INFILE>;
                close(INFILE);
                $return=join("",@text);
                $return='';
        }