PDA

View Full Version : Bug fix for pdftohtml


alivin70
02-25-2004, 08:19 AM
It's documented (http://www.phpdig.net/showthread.php?s=&threadid=522) that pdstohtml doesn't work with phpdig and PHP 4.2.x.

That due to a bug in the PHP function file($file) when a remote url is passed to it.

Here is a patch that allow pdftohtml work with PHP 4.2.x.
Find the line $file_content = @file($uri);in robot_function.php and replace it with//$file_content = @file($uri);
// Bug fix -- 2004/02/25 By VinSoft --
$remoto = fopen($uri,'rb');
while(!feof($remoto)) {
$file_content[]=fread($remoto,4096);
}

Now my pdftohtml (and xls2csv) works fine!

Bye for now
Alivin 70