Is it possible to read text in a pdf file using perl?

I want to parse text from a pdf file into perl without converting the PDF to any other format. Is it possible?

+3
source share
1 answer

Yes, you can.

Take a look at CAM :: PDF .

You can use this module to pull text.

 my $pdf = CAM::PDF->new($filename);
 my $pageone_tree = $pdf->getPageContentTree(1);
 print CAM::PDF::PageText->render($pageone_tree);
+8
source

Source: https://habr.com/ru/post/1772056/


All Articles