开发者

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

开发者 https://www.devze.com 2023-01-22 17:56 出处:网络
I want to parse thetext from a pdf file in perl without converting the pdf into any o开发者_C百科ther format . Is it possible ?Yes you can.

I want to parse the text from a pdf file in perl without converting the pdf into any o开发者_C百科ther 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);
0

精彩评论

暂无评论...
验证码 换一张
取 消