How can I extract text from a PDF file in Perl?

后端 未结 8 1330
花落未央
花落未央 2020-12-03 05:08

I am trying to extract text from PDF files using Perl. I have been using pdftotext.exe from command line (i.e using Perl system function) for extra

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 05:30

    i tried this module which is working fine for special characters of pdf..

    !/usr/bin/perl
    use strict;
    use warnings;
    use PDF::OCR::Thorough;
    
    my $filename = "pdf.pdf";
    
    my $pdf = PDF::OCR::Thorough->new($filename);
    my $text = $pdf->get_text();
    print "$text";
    

提交回复
热议问题