用php搜索pdf文件
我有一个网站,内容主要是pdf。当用户从表单中输入关键字,然后显示包含该关键字的pdf文件时,是否有可能通过该关键字进行搜索您可以用来从pdf获取文本 例如:用php搜索pdf文件,php,pdf,Php,Pdf,我有一个网站,内容主要是pdf。当用户从表单中输入关键字,然后显示包含该关键字的pdf文件时,是否有可能通过该关键字进行搜索您可以用来从pdf获取文本 例如: $pdf = new PDF2Text(); $pdf->setFilename('pdffile.pdf'); //select the pdf $pdf->decodePDF(); //process the pdf echo $pdf->output(); //output the text from the PD
$pdf = new PDF2Text();
$pdf->setFilename('pdffile.pdf'); //select the pdf
$pdf->decodePDF(); //process the pdf
echo $pdf->output(); //output the text from the PDF
如果要按单词搜索,可以使用列为
word
和pdf
的表在数据库中创建索引,并用从文件读取的单词及其在服务器上的位置填充索引。您不必为每个请求扫描所有文件,只需查询数据库即可
可以创建类似的解决方案或其他类型的搜索。欢迎使用StackOverflow,请使用。谢谢,让我试试