Re: phptotext]

From: Date: Tue, 20 Sep 2005 17:50:40 +0000
Subject: Re: phptotext]
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-40321@lists.php.net to get a copy of this message
if there is only English word inside pdf, I can retrieve text from pdf, but there are involved Japanese text inside pdf, I got error and can not retrieve any text from pdf. I would like to retrieve text from pdf. It is not necessarey to retrieve Japanese text. code----------------------------------------------------------- $handle = popen("/usr/bin/pdftotext \"$original_tmp\" - -layout 2>&1", 'r'); $strbuf = fread($handle, 2048000); echo $strbuf;// showing error message "Error: " $strbuf = addslashes($strbuf); pclose($handle); $sql_insert = "INSERT INTO view(b_col,file_name,file_size,file_type,file_date,vtext) VALUES ('$binaryContent','$original_name','$original_size','$original_type',CURTIME(),'$strbuf')"; Vicente wrote:
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..


« previous php.db (#40321) next »