Forum


Replies: 11   Views: 2307
Pdf lossless compression doesn't work?
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  · 01-04-2020 - 20:22

Hello,

What version of LibreOffice are you using? Maybe you are using a very old version?

We are sure that the problem comes from not using the correct Module1.xba or an external problem we can't guess. We recommend you to install the latest release of libreoffice (https://www.libreoffice.org/) and try the same macro using libreoffice directly. Running LibreOffice macros from the command line is a common task:

https://superuser.com/questions/1135850/how-do-i-run-a-libreoffice-macro-from-the-command-line-without-the-gui

To be able to use them with PHP, first, they need to work directly with LibreOffice. And also note that PHP may use another home folder than calling the main libreoffice exec from the command line, so first you need to be able to call the macro using the command line:

/opt/libreoffice6.4/program/soffice --invisible "macro:///Standard.Module1.LosslessPdf(/var/www/document/output.docx)"

Using --backtrace you can debug the output of LibreOffice: https://ask.libreoffice.org/en/question/40490/enable-debug-or-log-errors-using-libreoffice-for-linux/

Regards.