Skrol29 / opentbs

With OpenTBS you can merge OpenOffice - LibreOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use OpenOffice - LibreOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats. That is the Natural Template philosophy.
http://www.tinybutstrong.com/opentbs.php
70 stars 17 forks source link

Change color in powerpoint chart. #4

Closed nbiz57 closed 6 years ago

nbiz57 commented 6 years ago

Hello , I'm trying to change the color of a chart in a powerpoint template. I've managed to change text color looping through all slide with "OPENTBS_SELECT_SLIDE" and changing the color with $TBS->Source = str_replace("1E3C72", "00ffab", $TBS->Source);

How can I change the color of the chart ? Thanks

Skrol29 commented 6 years ago

Hello,

The chart definition is stored in a separated sub-file. In a PPTX it is typically a sub-file named like « ppt\charts\chart1.xml ». You can find the actually sub-file using the command OPENTBS_CHART_INFO with option « $Complete = true ».

In order to change a color, such color in the template must be a Standart color, not a Theme color, other wise you cannot change it because it simply not appears in XML source but i a separated sub-file related to Styles.

Since you know the sub-file corresponding to the Chart, you can open it using the command OPENTBS_SELECT_FILE, and then change the color using your snipped.

nbiz57 commented 6 years ago

Thanks mate,

It works like a charm ;)