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

Unable to read slide note #326

Open
jasonhuhx opened this issue Feb 23, 2017 · 3 comments
Open

Unable to read slide note #326

jasonhuhx opened this issue Feb 23, 2017 · 3 comments

Comments

@jasonhuhx
Copy link

jasonhuhx commented Feb 23, 2017

I am trying to read slide note from an external .pptx file, however unable to do so. The slideNote property inside PhpOffice\PhpPresentation\Slide\SlideLayout is always null.

Here is my code trying to retrieve note text from a slide

$pptReader = IOFactory::createReader('PowerPoint2007');
$oPHPPresentation = $pptReader->load('Sample_09_SlideNote.pptx');
$slide = $oPHPPresentation->getSlide(0);
var_dump($slide->getNote()->getShapeCollection()); // empty array

Sample_09_SlideNote.pptx


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Progi1984 Progi1984 self-assigned this Mar 5, 2017
@Progi1984 Progi1984 added this to the 0.8.0 milestone Mar 5, 2017
@Progi1984
Copy link
Member

@jasonhuhx Could you test the develop branch ? Normally, it's done for PowerPoint2007 & PowerPoint97.

@jasonhuhx
Copy link
Author

@Progi1984 Confirmed working for PowerPoint2007. Here is my code to retrieve plain text from slide notes:

$pptReader = IOFactory::createReader('PowerPoint2007');
$oPHPPresentation = $pptReader->load('Sample_09_SlideNote.pptx');

$slide = $oPHPPresentation->getSlide(0);
foreach ($slide->getNote()->getShapeCollection() as $shape) {
  foreach ($shape->getParagraphs() as $paragraph) {
    var_dump($paragraph->getPlainText());
  }
}

However I'm untable to test PowerPoint97 because the following code is giving me error PowerPoint97 Reader : readRecordOfficeArtSpgrContainer.

$pptReader = IOFactory::createReader('PowerPoint97');
$oPHPPresentation = $pptReader->load('Sample_09_SlideNote.ppt');

The .ppt file I'm using is converted down from .pptx, on PowerPoint for Mac.

Sample_09_SlideNote.ppt.zip

Progi1984 added a commit to Progi1984/PHPPresentation that referenced this issue Mar 6, 2017
@Progi1984
Copy link
Member

PR #342

@Progi1984 Progi1984 modified the milestones: 0.8.0, 0.9.0 Apr 3, 2017
@Progi1984 Progi1984 modified the milestones: 0.9.0, 0.10.0 Jul 5, 2017
@Progi1984 Progi1984 modified the milestones: 1.0.0, 1.1.0 Sep 9, 2021
@Progi1984 Progi1984 modified the milestones: 1.1.0, 1.2.0 Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants