Relative Content

Tag Archive for phpword

How to center roman numeral page numbers using PHPWord

I’m attempting to generate lower case roman numeral page numbers that are centered in the footer of the page using PHPWord. I’ve got the numbers showing up appropriately however, I can’t figure out how I can tell PHPWord that the field should have an alignment of center.

PHPWord header: table smaller than on page

Using PHPWord, I want to put a table on the page and one with the same width in the header. However, the table in the header is a little smaller than the one in the body.

PhpOfficePhpWord 1.2.0 – TemplateProcessor add numeric list item dont work

if (!empty($params[‘responsibilitiesItems’])) { $cnt = count($params[‘responsibilitiesItems’]); $templateProcessor->cloneBlock(‘responsibilitiesItems’, $cnt, true, true); $section = new Section($cnt); foreach ($params[‘responsibilitiesItems’] as $responsibilitiesItem) { $section->addListItem($responsibilitiesItem, 0, [‘italic’ => true, ‘color’ => ‘red’], ListItem::TYPE_NUMBER); } $i = 0; foreach ($section->getElements() as $getElement) { $i++; $templateProcessor->setComplexValue(“responsibilitiesItem#{$i}”, $getElement); } } As result i have corrupt php word file, if open this file in […]