ncjoes / office-converter

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

Not working under windows #34

Open shangyanjin opened 3 years ago

shangyanjin commented 3 years ago

Not working under windows.

Raja-Omer-Mustafa commented 2 years ago

Works with WAMP 3.2.5 Php 8.0.7 Need to Add C:\Program Files\LibreOffice\program" in environmental Variable after installing LibreOffice use this code to initialize a converter $converter = new OfficeConverter("sample.docx", "sample.pdf", "soffice.bin ", false); Still having problem using XAMP and down php versions use can use this command on CMD on windows to check if LibreOffice configure successfully soffice.bin --headless --convert-to pdf "369772.docx" --outdir "369772.pdf"

drsoong commented 1 year ago

Re. XAMPP I believe the issue is that the Windows user may not have write rights. I changed user rights for the specific folder. In addition (not related to the issue here but still imporant) add the libre office path to your environmental variables e. g. something like this C:\Program Files\LibreOffice\program and initialize the converter as said above like $converter = new OfficeConverter("sample.docx", "sample.pdf", "soffice.bin ", false); This worked for me.