This project is read-only.

Apply shadow effect to a table (patch)

Jan 7, 2012 at 12:50 PM
Edited Jan 7, 2012 at 1:13 PM

Hello guys,

 

I wanted to apply a shadow effect to a table on my PPTX. This feature was not yet implemented.

I edited the PHPPowerPoint code to add this feature:

 

1) Edit the PowerPoint2007/slide.php file:

Replace (trunk 66844) line 584:

 

// a:tblPr
$objWriter->startElement('a:tblPr');
$objWriter->writeAttribute('firstRow', '1');
$objWriter->writeAttribute('bandRow', '1');
$objWriter->endElement();

 

By:

 

// a:tblPr
$objWriter->startElement('a:tblPr');
$objWriter->writeAttribute('firstRow', '1');
$objWriter->writeAttribute('bandRow', '1');

if ($shape->getShadow()->getVisible()) {
// a:effectLst
$objWriter->startElement('a:effectLst');

// a:outerShdw
$objWriter->startElement('a:outerShdw');
$objWriter->writeAttribute('blurRad', 		PHPPowerPoint_Shared_Drawing::pixelsToEMU($shape->getShadow()->getBlurRadius()));
$objWriter->writeAttribute('dist',			PHPPowerPoint_Shared_Drawing::pixelsToEMU($shape->getShadow()->getDistance()));
$objWriter->writeAttribute('dir',			PHPPowerPoint_Shared_Drawing::degreesToAngle($shape->getShadow()->getDirection()));
$objWriter->writeAttribute('algn',			$shape->getShadow()->getAlignment());
$objWriter->writeAttribute('rotWithShape', 	'0');

// a:srgbClr
$objWriter->startElement('a:srgbClr');
$objWriter->writeAttribute('val',		$shape->getShadow()->getColor()->getRGB());

// a:alpha
$objWriter->startElement('a:alpha');
$objWriter->writeAttribute('val', 	$shape->getShadow()->getAlpha() * 1000);
$objWriter->endElement();

$objWriter->endElement();

$objWriter->endElement();

$objWriter->endElement();
}

$objWriter->endElement();

 

 

I hope it will help and be add to the next trunk release :)

 

Best regards,

rkshell