Forum


Replies: 6   Views: 819
Setdefaultfont method on existing document text
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by usman12  · 27-05-2022 - 12:33

Thanks for your quick response.

I have tried to use setDocumentDefaultStyles but it didn't work.

my updated code:

$docx = new \Phpdocx\Create\CreateDocxFromTemplate($tempFilePath);

$style = array(
    'color' => 'ff0000',
    'fontSize' => 14,
    'font'=>'Arial'
);

$docx->setDocumentDefaultStyles($style);

$docx->createDocx($new_file_path);

I have opened the CreateDocxFromTemplate.php class and could not find the method setDocumentDefaultStyles but I found it in CreateDocx which is not helpful in my case because I have to modify the font of the template. 

Thanks & Regards