Replies: 4   Views: 1920
Docx without phpdocx styles
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 admin  · 20-10-2019 - 16:53


phpdocx uses internal styles to be able to add new contents correctly. These styles are set in the base template (templates/phpdocxBaseTemplate.docx in Basic, Advanced and Premium licenses) and in the DOCXStructureTemplate.php file in the Premium license.

When using a custom template, some styles are imported. These default styles are available in OOXMLResources.php, $defaultPHPDOCXStyles variable. This is a static public variable so you can overwrite to set the styles to be imported (for example a set of them or none of them):

OOXMLResources::$PHPDOCXStyles = '<w:styles xmlns:w=""/>';

$docx = new CreateDocxFromTemplate('document.docx');

You may need to use custom styles from your DOCX for new contents if needed (such as headings).