从pdf,docx和doc打印文本

There are number of .docx ,doc and .pdf files in a folder.Here i am printing the files of all the files inside then folder then i am checking there extension.I have done only for pdf ,here if the extension is pdf then i am iterating through each every document in pdf to print its contents.But here i am recieving nothing ,The browser is showing no data recieved

Here is my code

 foreach (new DirectoryIterator('flies/') as $file) {
    if($file->isDot()) continue;
        $path_info = pathinfo($file);
        $extension=$path_info['extension']; 
        if($extension === 'pdf')
        {
            foreach($file as $value)
            {
                include_once('class.pdf2text.php');
                $a = new PDF2Text();
                $a->setFilename($value); 
                $a->decodePDF();
                echo $a->output(); 
            }         
        }
}