Thank you for your quick reply. I succesfully get text from pdf. But this text include error messages. I do not want these error messages. How can I ignore these error. I knew it is font problem. Do you know how to retrieve error using pdftotext option? my platform is debian linux. $handle = popen("/usr/bin/pdftotext \"$original_tmp\" - -layout 2>&1", 'r'); $fileread = fopen($original_tmp, "r"); while( ($point = fread($handle, 10 )) !== false) { echo $point; } --the error---------------------------------------------- Error: PDF version 1.6 -- xpdf supports version 1.5 (continuing anyway) Error: Bad annotation action Error: Unknown character collection 'Adobe-Japan1' Error: Unknown font tag 'C0_0' Error (185908): No font in show Error: Unknown font tag 'C0_0' Error (197322): No font in show Error: Unknown font tag 'C0_0' Error: Unknown font tag 'C0_0' Regards, Yui Micah Stevens wrote: > Well, of course, this assumes that your pdftotext program is located > at /usr/bin/. You're getting some error, and stderr is not being shown using > this. Change the line to this: > > $handle = popen("/usr/bin/pdftotext \"$original_name\" - -layout 2>&1", 'r'); > > That 'should' redirect stderr to the fread statement. > -Micah > > On Sunday 18 September 2005 5:35 am, Yui Hiroaki wrote: > >>Thank you for your quick reply. >>So I try to rewrite code again below; >> >>$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! >> >>Yui >> >>Micah Stevens wrote: >> >>>Just read the command docs, and you'll come up with something like this: >>> >>>$handle = popen("/usr/bin/pdftotext \"uploads/$filename\" - -layout ", >>>'r'); $read = fread($handle, 2048000); >>>pclose($handle); >>> >>>$read = text content of pdf. >>> >>>-Micah >>> >>>On Saturday 17 September 2005 6:29 am, Yui Hiroaki wrote: >>> >>>>I would like to retrieve text from pdf. So I try to comand pdftotext at >>>>xpdf command. >>>> >>>>How can I write code? >>>> >>>>ex; >>>> >>>><?php >>>>$original_tmp = $_FILES['UploadedFile']['tmp_name']; >>>>$original_name = $_FILES['UploadedFile']['name']; >>>> >>>>$fileHandle = fopen($original_tmp, "r"); >>>>$uu=exec('pdftotext $original_name');//or system('pdftotext >>>>$original_name'); >>>> >>>>?> >>>> >>>><form method="post" action="document.php" enctype="multipart/form-data"> >>>><input type="hidden" name="MAX_FILE_SIZE" value="512000"> >>>><input type="file" name="UploadedFile" style="border: 1px solid; >>>>width:200px; height:20px; position:absolute; left:100px; top:100px; >>>>"><br> <input type="submit" value="upload" style="border: 1px solid; >>>>width:200px; height:20px; position:absolute; left:100px; top:130px; "> > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php