ncjoes / office-converter

PHP Wrapper for LibreOffice
MIT License
197 stars 75 forks source link

What causes the "Convertion Failure! Contact Server Admin." Error #4

Closed Olusiji closed 6 years ago

Olusiji commented 6 years ago

Hi, I installed LibreOffice on my Linux Centos VM and installed office-converter. But when i try to convert a docx to Pdf I get the "Convertion Failure! Contact Server Admin." error.

Please what are the possible causes of this error

zanotta commented 6 years ago

Same problem here.

zanotta commented 6 years ago

@Olusiji not sure if it's still relevant to you, but in the end i only used this line:

"{$libreoffice} --headless --convert-to {$outputExtension} {$oriFile} --outdir {$outputDirectory}";

$libreoffice should be the path to the "soffice" file, inside the LibreOffice installation folder/program

Working converting docx to pdf. If you need any further help, let me know.

Olusiji commented 6 years ago

@RodrigoZanotta Thanks. It seems the command in the library was not matching my version of libreoffice installed, so I modified the class's construct to run the command as libreoffice6.0 as opposed to libreoffice public function __construct($filename, $tempPath = null, $bin = 'libreoffice6.0')

CtrlShiftN commented 4 years ago

@Olusiji not sure if it's still relevant to you, but in the end i only used this line:

"{$libreoffice} --headless --convert-to {$outputExtension} {$oriFile} --outdir {$outputDirectory}";

$libreoffice should be the path to the "soffice" file, inside the LibreOffice installation folder/program

Working converting docx to pdf. If you need any further help, let me know.

I have a list of URLs, how can I do sth like this? Please help me, I want to convert from .doc to plain text or HTML. but what I need is something like PHP code. Thank you!

priioom commented 4 years ago

Hi, I installed LibreOffice on my windows 10. But when I try to convert a Docx to Pdf. I get the "Conversion Failure! Contact Server Admin." error. I have changed libreoffice to libreoffice6.0.6 but it's not working. I am using libreoffice 6.0.6. Please help me what are the possible causes of the error. And how to overcome it. Thanks in Advance

zanotta commented 4 years ago

Hi, I installed LibreOffice on my windows 10. But when I try to convert a Docx to Pdf. I get the "Conversion Failure! Contact Server Admin." error. I have changed libreoffice to libreoffice6.0.6 but it's not working. I am using libreoffice 6.0.6. Please help me what are the possible causes of the error. And how to overcome it. Thanks in Advance

Can you post your code?

agumaxwellforcode commented 4 years ago

Please was this later solved?

pfleu commented 4 years ago

For Windows, you have to change the source code, as said here Too bad you can't just add a parameter in the construct method (you can change the $bin parameter through the __construct, but you must edit manually the 'export' line 245, changing it to 'set')