-
Notifications
You must be signed in to change notification settings - Fork 534
Description
Hi, I'm trying to import a file
$pptReader = IOFactory::createReader($reader);
$oPHPPresentation = $pptReader->load($path);
$designData = [];
$i=0;
foreach ($oPHPPresentation->getAllSlides() as $oSlide) {
foreach ($oSlide->getShapeCollection() as $oShape) {
if ($oShape instanceof Group)
foreach ($oShape->getShapeCollection() as $oShapeChild) {
$designData['pages'][$i]['decors'][] = [
'x' => $oShapeChild->getOffsetX(),
'y' => $oShapeChild->getOffsetY(),
'w' => $oShapeChild->getWidth(),
'h' => $oShapeChild->getHeight(),
'angle' => $oShapeChild->getRotation(),
];
}
else
$designData['pages'][$i]['decors'][] = [
'x' => $oShape->getOffsetX(),
'y' => $oShape->getOffsetY(),
'w' => $oShape->getWidth(),
'h' => $oShape->getHeight(),
'angle' => $oShape->getRotation(),
];
}
$i++;
}
But I getting almost all zero values:
array:1 [
"pages" => array:5 [
0 => array:1 [
"decors" => array:2 [
0 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
1 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
]
]
1 => array:1 [
"decors" => array:2 [
0 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
1 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
]
]
2 => array:1 [
"decors" => array:2 [
0 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
1 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
]
]
3 => array:1 [
"decors" => array:5 [
0 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
1 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
2 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
3 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
4 => array:5 [
"x" => 0
"y" => 0
"w" => 0
"h" => 0
"angle" => 0
]
]
]
4 => array:1 [
"decors" => array:1 [
0 => array:5 [
"x" => 399
"y" => 414
"w" => 153
"h" => 55
"angle" => 0
]
]
]
]
]