line spacing?

Sep 21, 2011 at 11:51 PM

Quick question: Is it possible to set line spacing?  That is, multiple lines separated by breaks or carriage returns are separated by a greater distance than a line of long text that natural breaks when it reaches the edge of the shape?


I can do this manually in powerpoint, but can't seem to find the setting in PHPPowerpoint.  I could insert a tiny carriage return with a smaller font, but it would be best to do something more elegant.

Thanks!

Sep 29, 2011 at 12:21 AM

I'm making significant progress on this.  It's not possible with the current code.. a tag of the style <a:spcBef><a:spcPts val="1000"/></a:spcBef> (where 1000 = 0.35mm is the spacing before) needs to go inside the <a:pPr> tag. 

Sep 29, 2011 at 8:26 PM

Ok, made a patch!  I tried my best to emulate current formating, naming and doumentation conventions, but things like tab spacing might be screwed up.

Also, this appears only to work in PowerPoint... Every attempt I made to add line spacing to pptx files using LibreOffice (even manually) failed.

Usage:

$shape->getActiveParagraph()->getSpacing()->setSpaceBefore(1200);

$shape->getActiveParagraph()->getSpacing()->setSpaceAfter(2400);

would create 12pt of spacing before the paragraph, 24pt of spacing after it.

PHP PowerPoint Spacing Patch