PHP Pdf内容获取

it2022-05-05  235

//执行脚本 =生成txt文本 shell_exec('/usr/local/bin/pdftotext -layout '.$file_url(这里是文件的路劲));

-layout 参数可切换  -p等等  一个会换行  一个不会

$filename = str_replace(strrchr($file_url, '.'), '', $file_url);//文件名 //获取文件内容 去除空格及不定义字符 $content = file_get_contents($filename.'.txt'); $count_txt = $content; $oldchar=array(" "," ","\t","\n","\r"); $newchar=array("","","","",""); $content = str_replace($oldchar,$newchar,$content);

输出|PDF内容字符串


最新回复(0)