PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

Add Paragraph Styling to the setComplexValue() on the TemplateProcessor

Open StiaanBouwer opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I am using the TemplateProcessor to add dynamic data to my template. The font styling imports successfully, but I can't add paragraph styling to injected data. (Alignment, line spacing, etc.)

Describe the solution you'd like

As with using the setComplexValue() method, I would like to add paragraph styling in addition to the font styling.

Describe alternatives you've considered

I have altered the paragraph styling in the template itself, which works fine, however, for the system I am working on, I need to be able to inject dynamic paragraph styling for every TextRun into the template as defined by the user.

Additional context

Example:

$inline = new TextRun();
$inline->addText('by a red italic text', array('italic' => true, 'color' => 'red'), array('alignment' => 'center'));
$templateProcessor->setComplexValue('inline', $inline);

StiaanBouwer avatar Nov 18 '21 12:11 StiaanBouwer

I also tried it, didn't work

raybon-lee avatar Jun 06 '22 09:06 raybon-lee

Not working in 1.1.0

tocsa avatar Nov 10 '23 06:11 tocsa