Special Characters / Symbols

May 16, 2012 at 11:12 PM

Has anyone been able to insert special charcters into a dynamically created PowerPoint presentation?  I've tried everything I can think of - utf_encode, html_entity_decode.   I need to output symbols such as less than or equal (≤) and alpha (α), but have had no success.

Thank you in advance!

Aug 8, 2012 at 6:30 PM
Edited Aug 8, 2012 at 6:31 PM

I had this issue, it is actually due to the character encoding on the XML files being written out to the presentation. As a quick and dirty fix for slides, I changed line 230 in ./Classes/PHPPowerpoint/Writer/PowerPoint2007.php from 

$objZip->addFromString('ppt/slides/slide' . ($i + 1) . '.xml', $this->getWriterPart('Slide')->writeSlide($this->_presentation->getSlide($i)));

to

$objZip->addFromString('ppt/slides/slide' . ($i + 1) . '.xml', utf8_encode($this->getWriterPart('Slide')->writeSlide($this->_presentation->getSlide($i))));

Once I've done a bit more testing & take a look at other possible areas where this is needed, I'll upload as a patch.

Aug 12, 2012 at 4:01 AM

Hey hi

I had already inserted special characters, y just modify the file RichText.php

from

    public function createTextRun($pText = '')
    {
        return $this->_richTextParagraphs[$this->_activeParagraph]->createTextRun($pText);
    }

 

to

 

    public function createTextRun($pText = '')
    {

       textoRecibe=utf8_encode($pText);
        return $this->_richTextParagraphs[$this->_activeParagraph]->createTextRun($textoRecibe);
    }

 

And in the ppt php whe you need to put a text with special character just put this:

 

$textRun = $shape->createTextRun(utf8_decode('Administración'));

 

Saludos!