Hello,
The problem is that the attached PDF documents have not been generated with the same version of LibreOffice (you can read this same information with a PDF viewer):
- Sample - CLI.pdf: generated with LibreOffice 7.1
- Sample - PHP.pdf: generated with LibreOffice 6.0
LibreOffice 6.0 is a very old version and it's not returning a good conversion. Please use LibreOffice 7 to get a proper conversion. You have not used the same version of LibreOffice: LibreOffice 7.1 in CLI and LibreOffice 6.0 with PHP.
If your server has more than one version of LibreOffice installed, please check you are setting the path in config/phpdocxconfig.ini to the correct version of LibreOffice you want to use. For example, if LibreOffice 7 is installed in /opt/libreoffice7.1:
; libreoffice installation path, absolute path
path = "/opt/libreoffice7.1/program/soffice"
Regards.