Forum


Replies: 10   Views: 966
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 - 14:52

Hello,

The macro is fully tested using Windows too. In any case, we have tested it again using Windows and LibreOffice with the macro included in phpdocx 10, and the PDF A-1 is generated correctly.

If the PDF is not being generated then the macro has not been added to the correct Module1.xba file (maybe in your installation you are using another path as HOME user folder) or there's some issue related to paths or permissions.

We recommend you open LibreOffice to check the exact macro file you need to change and also test the same using a terminal (PowerShell or CMD).

We have tested it following these simple steps and everything is working correctly:

  • Path to libreoffice in config/phpdocxconfig.ini:
; libreoffice, native, msword, openoffice
method = "libreoffice"

; libreoffice installation path, absolute path
path = '"C:\Program Files\LibreOffice\program\soffice"'
  • Macro into the Module1.xba file.
  • Run the following command:
$docx->transformDocument('document.docx', 'document.pdf', 'libreoffice', array('pdfa1' => true));

using PHP CLI:

> php sample_1.php

and the PDF A-1 is generated correctly.

Sorry, but we don't know the exact step you have not done correctly. We'd need to check your server.

Regards.