Skip to content
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

.doc file can not be read #2389

Open
liuts-plane opened this issue Mar 28, 2023 · 3 comments
Open

.doc file can not be read #2389

liuts-plane opened this issue Mar 28, 2023 · 3 comments

Comments

@liuts-plane
Copy link

Describe the Bug

I am reading a .doc file, and the code is following:

IOFactory::load($filePath, 'MsDoc')

I run it and show the error: Uninitialized string offset: 3648

otherwise:
1.the .docx file is always can be read !
2. similar common issue i had read, but the bug is Still exists

Steps to Reproduce

Please provide a code sample that reproduces the issue.

<?php
require __DIR__ . '/vendor/autoload.php';
use PhpOffice\PhpWord\IOFactory;

$filePath = __DIR__ . '/../../../public/zzz97.doc';
$loader = IOFactory::load($filePath, 'MsDoc');

Expected Behavior

have no error

Current Behavior

Uninitialized string offset: 3648

Context

Please fill in your environment information:

  • PHP Version:7.1.33
  • PHPWord Version:0.18.3
@cavasinf
Copy link

cavasinf commented Jun 26, 2023

Convert your .doc into .docx.
Since .doc is only supported by Word, you should maybe open it from there and save it as .docx.

The DOCX format was introduced with the launch of the MS Word 2007 and is still the file format up to now.
PhpWord use Word2007 "logic" by default.

@nhuttranm
Copy link

nhuttranm commented Jun 26, 2023

Could you please using the unoconv to convert from .doc to .pdf

@Progi1984
Copy link
Member

@liuts-plane Could you send us a sample file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants