ncjoes / office-converter

PHP Wrapper for LibreOffice
MIT License
207 stars 78 forks source link

Having "Convertion Failure" after upgrading to 1.0.7 #63

Open rougin opened 3 weeks ago

rougin commented 3 weeks ago

Hello! After I upgraded this package in one of my projects to the latest version (1.0.7), it encountered an error during its conversion:

PHP Fatal error: Uncaught NcJoes\\OfficeConverter\\OfficeConverterException: Convertion Failure! Contact Server Admin:code 77 
error: javaldx failed!
Warning: failed to read path from javaldx
LibreOffice 6.4 - Fatal Error: The application cannot be started.
User installation could not be completed. in /var/www/html/vendor/ncjoes/officeconverter/src/OfficeConverter/OfficeConverter.php:284

Here is the code that I wrote below for the conversion (from .docx to `.pdf):

use NcJoes\OfficeConverter\OfficeConverter;

function print($file)
{
    $pdf = str_replace('docx', 'pdf', $file);

    (new OfficeConverter($file))->convertTo($pdf);

    unlink($file);

    return $pdf;
}

print('sample.docx');

While below is the version of LibreOffice installed in the system:

LibreOffice 6.4.7.2 40(Build:2)

I reverted it back to 1.0.5 in order to fix the issue temporarily.

Mi-Zaft commented 1 day ago

I have the same error. I am using LibreOffice 7.4.7.2 40(Build:2) I tried office-converter versions 1.0.7 and 1.0.6.

What could be wrong?

Convertion Failure! Contact Server Admin:code 77 error: javaldx failed! Warning: failed to read path from javaldx LibreOffice 7.4 - Fatal Error: The application cannot be started. User installation could not be completed.