PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.31k stars 520 forks source link

Error loading PPT #734

Open s873468834 opened 1 year ago

s873468834 commented 1 year ago

$reader = IOFactory::createReader('PowerPoint2007'); $fileClass = $reader->load("./3.pptx"); //$counts = $fileClass -> getSlideCount();

Argument 3 passed to PhpOffice\PhpPresentation\Reader\PowerPoint2007::loadShapeRichText() must be an instance of PhpOffice\PhpPresentation\Slide\AbstractSlide, instance of PhpOffice\PhpPresentation\Slide\Note given, called in phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint2007.php on line 1375

`

                if ($oSubElement->hasAttribute('val')) {
                    $oShape->getShadow()->setAlpha((int) $oSubElement->getAttribute('val') / 1000);
                }
            }
        }

        $oSlide->addShape($oShape);
    }

    protected function loadShapeRichText(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
    {
        if (!$document->elementExists('p:txBody/a:p/a:r', $node)) {
            return;
        }
        // Core
        $oShape = $oSlide->createRichTextShape();
        $oShape->setParagraphs([]);
        // Variables
        if ($oSlide instanceof AbstractSlide) {

`

s873468834 commented 1 year ago

solved https://github.com/PHPOffice/PHPPresentation/issues/710

Progi1984 commented 2 months ago

@s873468834 Hi, Could you send me a sample file with error, please, for reproducing the bug ?