Ошибка при открытие Word файла сгенерированного PHPWord

Есть код генерирующий файл 1.doc

$phpWord = new \PhpOffice\PhpWord\PhpWord();
     
   

        // Adding an empty Section to the document...
        $section = $phpWord->addSection();
        // Adding Text element to the Section having font styled by default...
        $section->addText(
            '"Learn from yesterday, live for today, hope for tomorrow. '
                . 'The important thing is not to stop questioning." '
                . '(Albert Einstein)'
        );

        /*
         * Note: it's possible to customize font style of the Text element you add in three ways:
         * - inline;
         * - using named font style (new font style object will be implicitly created);
         * - using explicitly created font style object.
         */

        // Adding Text element with font customized inline...
        $section->addText(
            '"Great achievement is usually born of great sacrifice, '
                . 'and is never the result of selfishness." '
                . '(Napoleon Hill)',
            array('name' => 'Tahoma', 'size' => 10)
        );

      
        $section->addText(
            '"The greatest accomplishment is not in never falling, '
                . 'but in rising again after you fall." '
                . '(Vince Lombardi)',
            array('name' => 'Tahoma', 'size' => 10)
        );

        

        // Saving the document as OOXML file...
        //$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
        $phpWord->save('1.doc','Word2007',true);

Файл генериться и отдаётся в output. Но при открытие файла в Word 2016 появляется ошибка

введите сюда описание изображения

В чём может быть причина?

P.S. Если нажать OK и восстановить файл в Word, то в нём оказывается правильное содержимое.


Ответы (0 шт):