Forum


Replies: 10   Views: 627
Tranformdocument docx to pdf/a
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  · 27-02-2023 - 13:54

Hello,

All macros included in phpdocx to be used with LibreOffice must be added to the Module1.xba file, because they work using PHP methods such as:

$docx->transformDocument('document.docx', 'document.pdf', 'libreoffice', array('toc' => true));
$docx->transformDocument('document.docx', 'document.docx', 'libreoffice', array('comments' => true));

so they need one or more arguments to run.

These macros work will all OS where LibreOffice can be installed. Windows also has a Module1.xba file (the default path of this file is in the AppData\Roaming\LibreOfice folder of the user's profile).

Adding them using LibreOffice GUI requires removing parameters/URLs (they are not used by the LibreOffice GUI) and replacing protected characters. phpdocx supports adding them to the Module1.xba so they can be called from PHP. Sorry but we don't have macro versions to be added using the LibreOffice GUI. In this case, that is not used phpdocx, we recommend you check the documentation from LibreOffice:

https://books.libreoffice.org/en/GS70/GS7013-GettingStartedWithMacros.html#toc8

You can record a macro and the code we'll be generated automatically in the LibreOffice GUI.

Regards.