Re: phptotext]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux