Forum


Replies: 1   Views: 212
Dotm to pdf?
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  · 29-05-2024 - 06:33

Hello,

phpdocx can change DOTM files as DOCX files replacing and adding contents. Please note that DOCM must be saved with the docm extension. For example:

$docx = new CreateDocxFromTemplate('sample_template_docm.docm');

$first = 'New content';
$variables = array('VAR' => 'New content');
$docx->replaceVariableByText($variables);

$docx->addText('A new paragraph.');

$docx->createDocx('output.docm');

These files can be transformed to PDF using the conversion plugin. Due to security reasons, macros embedded in them won't run automatically. Please note that LibreOffice macros are not the same as MS Word macros. You may need to change the default settings of these programs to run macros.

Regards.