I'm using PHPword library to formant an existing .docx
file, But I could only replace a particular item from the original document. I actually want to change the styling of the whole document. Can anyone tell how to achieve this.
My Code:
<?php
require_once 'phpWord/PHPWord.php';
$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('test.docx');
$test = 'Indian';
// Replacing The word 'British' with 'Indian'
$document->setValue('British', $test);
$document->save('test2.docx');
?>
Thank you.
Check example here