Forum


Replies: 6   Views: 847
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 - 10:40

Hi,

I am using setDefaultFont method to change the font family of the document by opening the template using CreateDocxFromTemplate method, but it does not work.

However, when I add new text and apply font it works fine but does not change the default font.

I am using the premium license.

Here is my whole script:



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

$docx->setDefaultFont('Arial');

$docx->createDocx($new_file_path);

Thanks & Regards