Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu: command line app to convert office documents to PDF

Is there any command line app in Ubuntu that can convert Office documents to PDF, like convert Excel (xls,xlsx) and Word(doc, docx) to pdf in Ubuntu. I cannot used any Office suite, like Open Office.

I know that there are Java projects that can communicate with OpenOffice to use its functionality to convert documents to PDF, but not going in direction.

But if the OpenOffice people or LibreOffice people have created a stand-alone command-line app with this capability to covert documents to PDF, I would like that very much.

like image 509
Palu Avatar asked Oct 22 '25 16:10

Palu


1 Answers

Step - 1 Install Libreoffice.if it is not install in your system or server.

do follow:

libreoffice --headless --convert-to pdf your_file_path --outdir upload_directory

Here,

your_file_path : complete your file path like /var/www/mydocument.docx

upload_directory : complete directory like /var/www/

like image 72
Umesh Maliya Avatar answered Oct 25 '25 08:10

Umesh Maliya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!