Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When used below command on the command line it working file

libreoffice --headless -convert-to pdf ".$sourse." -outdir outputolder/

but, if use in php script nothing happen. Can anybody provide explanation on what is the exact issue with

share|improve this question

2 Answers 2

you are missing the filter name

This is the general format of convert-to (noting that on windows the parameter is :

-convert-to not --convert-to

soffice --headless --convert-to <TargetFileExtension>:<NameOfFilter> file_to_convert.xxx

Use the link to look for the filter names in the .xcu files.

For example, I wanted to convert to Excel 95 format so I found the MS_Excel_95.xcu filter and inside it has a name:

<node oor:name="MS Excel 95" oor:op="replace">
     ...

I could then try it out:

soffice --headless --convert-to xls:"MS Excel 95" filename.xlsx

(I needed this to get a non-xml version of an excel file)

Copied from : ask.libreOffice.org

share|improve this answer
1  
Please provide your answer in terms of steps and then try to refer a link, because links can expire or move to different location. –  VRU Jan 28 '13 at 9:29

Well, I can see that you typed "-convert-to pdf" instead of "--convert-to-pdf". Maybe you did a similar typo in your php script? Hard to say without seeing the PHP code, though.

Please provide details: how do you call libreoffice from PHP, what do the error logs say etc.

Finally, if you are running SElinux and not Ubuntu, please take the question to a SELinux forum.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.