简体   繁体   中英

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

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

Yes you can.

Take a look at the CAM::PDF package.

You can use this module to pull the text out.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM