网站建设 读取dock文字
2021-09-02来源:越跃科技
unoconv —— Linux中将DOCX文件转化为Text
yum install unoconv
/usr/bin/unoconv -f pdf /home/1.doc
/usr/bin/unoconv -f txt /home/1.doc
/usr/bin/unoconv -f txt /home/1.docx
unzip unoconv-master.zipcd unoconv-master/make install
/usr/bin/unoconv -f txt /www/1.docx
unzip Fonts.zipmkdir /usr/share/fonts/wincp Fonts/* /usr/share/fonts/wincd /usr/share/fonts/winchmod -Rf 755 * mkfontscale mkfontdir fc-cache –fv
shell_exec('/usr/bin/unoconv -f txt /www/1.docx - 2>&1');
$filename='/www/1.txt'; $handle = fopen($filename, "r");//读取文件 //通过filesize获得文件大小,将整个文件一下子读到一个字符串中 $contents = fread($handle, filesize ($filename));//获取到了内容 fclose($handle);//关闭文件 unlink($filename);//删除/www/1.txt