Actually, this also assumes you're on a *nix type server. If you're running on windows, you likely won't ever get this to work unless you compile pdftotext using cygwin, and install it that way, which considering your skill level, may be a bit much.
Otherwise I'm not sure I know of a windows equivilent. Keep in mind that there's excellent PHP docs on their site, I like them simply because the user comments are usually very helpful. It's obvious you aren't a born english speaker, but your skills should be good enough to get through the php docs. Just go read those. Also google for this stuff, I figure most of my 'darn, how would I do this' problems just be typing into google or A9 the problem.. For example, I just did a search on "php pdf to text" and 14 million items came up.. granted you'll have to dig through some stuff, but that's part of the job. Sorry to get up on a soap box, it just seems like you're not trying very hard, but I understand that you may be intimidated by language differences. -Micah On Sunday 18 September 2005 9:36 am, 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