For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > September 2005 > Re[2]: [PHP-DB] phptotext]









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re[2]: [PHP-DB] phptotext]
Vicente

2005-09-19, 9:55 pm

Yui wrote:

> $handle = popen("/usr/bin/pdftotext \"$original_name\" - -layout ",'r');
> $read = fread($handle, 2048000);
> echo $read;
> pclose($handle);
> But I can not see anything!!
> Please do help me!



$tmpfile = '/home/domain/public_html/pdf_files/myfile.pdf';
chmod ($tmpfile, 0777);
$salida = shell_exec("pdftotext /home/domain/public_html/pdf_files/$tmpfile 2>&1");

Here we assume pdftotext.exe is inside /home/domain/public_html/pdf_files/
Maybe you have this inside /usr/bin... etc. In this case be aware of
the security restrictions in your server when you try to execute a
program outside your secure environment.
If you have these problems then you can put the executable in the
same file's folder. No fear. It works.

Also, you can translate the pdftotext error codes or messages to
japanese ^_^

if (ereg('some words in the console answer', $salida)) {
print 'my message in jp';
}

etc..
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com