PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

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

Open WalidAxo opened this issue 8 months ago • 4 comments

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)

WalidAxo avatar May 29 '24 09:05 WalidAxo