gpt4 book ai didi

perl - 是否可以使用 perl 读取 pdf 文件中的文本?

转载 作者:行者123 更新时间:2023-12-01 05:15:12 31 4
gpt4 key购买 nike

我想在 perl 中解析 pdf 文件中的文本,而不将 pdf 转换为任何其他格式。可能吗 ?

最佳答案

是的,你可以。

看看CAM::PDF包。

您可以使用此模块将文本提取出来。

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

关于perl - 是否可以使用 perl 读取 pdf 文件中的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4049486/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com