Only Fail convert images and XLS, DOCS WORK (Convertion Failure! Contact Server Admin.)
LiThaM opened this issue · comments
Hi people,
I am getting this error when I select an image or excel, the rest works like DOCS.
I attach the code that I use.
ERROR:
exception: "NcJoes\\OfficeConverter\\OfficeConverterException"
file: "/Users/alejandrocastronantes/Documents/Trabajo/gestor-documental/vendor/ncjoes/office-converter/src/OfficeConverter/OfficeConverter.php"
line: 54
message: "Convertion Failure! Contact Server Admin."
ME CODE:
use NcJoes\OfficeConverter\OfficeConverter;
function convertToPdf($pathDocument, $newNameDocument)
{
$newNameFile = str_replace(' ', '_', $newNameDocument);
$converter = new OfficeConverter($pathDocument);
$converter->convertTo($newNameFile);
return $newNameFile;
}
Any one help Me?
You need to install libreoffice on its sever
Nice tip, need apt-get install libreoffice