willg Posted November 25, 2007 Share Posted November 25, 2007 Hi, I need to call the pdftotext.exe program in a php script. This code is what I have for the windows server. It used to work but doesn't anymore. I cannot change the server settings (so please don't suggest that) so can someone suggest a different coding way to call pdftotext.exe? Many thanks. Note that the pdftotext.exe file is in the same folder as the below script: <?PHP $file = "1.pdf"; $outpath = preg_replace("/\.pdf$/", "", $file).".txt"; system("pdftotext ".escapeshellcmd($file), $ret); if ($ret == 0) { $value = file_get_contents($outpath); unlink($outpath); print $value; } if ($ret == 127) print "Could not find pdftotext tool."; if ($ret == 1) print "Could not find pdf file."; ?> Quote Link to comment https://forums.phpfreaks.com/topic/78842-xpdf/ Share on other sites More sharing options...
trq Posted November 25, 2007 Share Posted November 25, 2007 It used to work but doesn't anymore. Define doesn't anymore, what results are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/78842-xpdf/#findComment-399033 Share on other sites More sharing options...
willg Posted November 25, 2007 Author Share Posted November 25, 2007 I just get a blank page instead of the expected text from the pdf Quote Link to comment https://forums.phpfreaks.com/topic/78842-xpdf/#findComment-399036 Share on other sites More sharing options...
willg Posted November 26, 2007 Author Share Posted November 26, 2007 Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/78842-xpdf/#findComment-399338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.