Skip to content

IOFactory::Load fails with "Cannot add Title in Header."  #2616

@WalidAxo

Description

@WalidAxo

Describe the bug and add attachments

Hi,
I'm trying to read a docx file with the following code :
$reader = IOFactory::createReader('Word2007');
$phpWord = $reader->load($copyFilePath);
$documentW = $phpWord->getSections();
I'm getting a bizarre behaviour from the "load" method saying ""Cannot add Title in Header."
I'm sure that my files is correct. I can open it on word, google doc, pages (macOS) and it's not corrupted.

I can't post the document here because it's confidential.
Capture d’écran 2024-05-29 à 11 07 40
Thank you for your help !
Best regards,

Expected behavior

The docx file should be loaded correctly. The error message is not clear on wha't wrong.

Steps to reproduce

I used the following code
$reader = IOFactory::createReader('Word2007');
$phpWord = $reader->load($copyFilePath);
$documentW = $phpWord->getSections();

PHPWord version(s) where the bug happened

1.2

PHP version(s) where the bug happened

8.0.30

Priority

  • I want to crowdfund the bug fix (with @algora-io) and fund a community developer.
  • I want to pay the bug fix and fund a maintainer for that. (Contact @Progi1984)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions