jeudi 31 décembre 2015

PHPWord unable to load *.doc (97-2003 MS Word) document files

I am trying to load 97-2003 MS Word documents but the following error keeps showing up.

image

Following is simply an adaptation of the code provided in the Sample_11_ReadWord97.php file:

    $source = "OldDoc.doc";
    echo "Reading document ".$source."<br><br>";
    if(str_contains($source, '.docx'))
        $phpWordObj = IOFactory::load($source);
    elseif(str_contains($source, '.doc'))
        $phpWordObj = IOFactory::load($source, 'MsDoc');
    echo "Document reading complete";

I am using Laravel 5.1 and docx files seem to load just fine. Any idea where I might be going wrong with this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1kvupUO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire