Skip to content

Unable to read .doc files #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mayankitt opened this issue Dec 31, 2015 · 2 comments
Closed

Unable to read .doc files #695

mayankitt opened this issue Dec 31, 2015 · 2 comments
Milestone

Comments

@mayankitt
Copy link

Hello,
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?

@vovanada
Copy link

Library has bug in this place https://github.com/PHPOffice/PHPWord/blob/v0.12.1/src/PhpWord/Reader/MsDoc.php#L144

class OLERead hasn't property documentSummaryInformation. It rename in this commit 90d64bd

You have four way to solve this problem:

  1. Wait for fix this library by developers
  2. Fix it
  3. Set error_reporting to 0
  4. Use old version of library

Similar topic:

#610
#503

vovanada pushed a commit to vovanada/PHPWord that referenced this issue Jan 12, 2016
@ghost
Copy link

ghost commented Feb 6, 2016

See #503.

@ghost ghost closed this as completed Feb 6, 2016
@ghost ghost self-assigned this Feb 6, 2016
@ghost ghost added this to the 0.13.0 milestone Feb 6, 2016
@ghost ghost added the Bug Report label Feb 6, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants