php and xps files

こ雲淡風輕ζ 提交于 2019-12-24 09:57:30

问题


i only want to import the content as text but im getting the binary values, tried something like but its doesnt work:

$data = file_get_contents("input.xps");

theres any lib that i can use? thank you


回答1:


You need a tool that can convert .xps files. There is a GhostScript variant called gxps which does exactly that. http://ghostscript.com/GhostXPS.html

Conversion to text would be a two step process with it, but still simple:

exec("gxps -sDEVICE=pdfwrite -sOutputFile=input.pdf -dNOPAUSE input.xps");
$text = exec("pdftotext input.pdf");


来源:https://stackoverflow.com/questions/5968464/php-and-xps-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!