

Well, you don’t have to worry about that anymore. For example, if the input file is MyWordFile.docx, the output file will be MyWordFile.pdf, and it seems there's no way to change this, so you will need to stick to this nomenclature.Let’s say you have to edit a PDF by adding images, texts, replacing or resizing the images,texts but don’t know how to do that? It is also the fact that for different applications or software you need different methods.

The only problem that exists till the date, is the fact that you cannot change the name of the output file.

indicates that the file should be saved in the current directory.įor example with a real Office 2013 document: libreoffice -headless -convert-to pdf MyWordFile.docx -outdir. -outdir: the directory where the converted file should be stored.-convert-to : this argument specifies that the tool will be used to convert the input file to a new format, which is given as positional argument of this parameter, in our case PDF.-headless: this argument launches libreoffice in headless mode, without UI.Convertir DOCX to PDFįinally, after installing LibreOffice you will be able to use it to convert your Microsoft Office Word document to PDF with the following command, whose parameters are described like this: libreoffice -headless -convert-to pdf -outdir The installation of Java will take about 180MB of space in your disk. Warning: failed to read path from javaldxĬonvert /home/ourcodeworld/Desktop/mydocument.docx -> /home/ourcodeworld/Desktop/mydocument.pdf using filter : writer_pdf_Export If it is already installed then try removing ~/.config/libreoffice/4/user/config/javasettings_Linux_*.xml Please ensure that a JVM and the package libreoffice-java-common If you don't install Java, you may find the following warning when trying to convert your document (the conversion will work though): javaldx: Could not find a Java Runtime Environment! If the command fails, it means that you don't have Java installed, so you need to install it through APT with the following command: sudo apt-get install default-jre

Install Java Runtime Environment (JRE)Īs next, be sure to have the Java Runtime Environment installed in your server using java -version. To use this in Ubuntu, be sure to update the repositories before continuing: sudo apt-get updateĪnd proceed with the installation of LibreOffice with the following command: sudo apt-get install libreoffice -no-install-recommends 2. This awesome applications offers a headless version that can be used from a terminal on your server or desktop. LibreOffice includes several applications that make it the most versatile Free and Open Source office suite on the market: Writer (word processing), Calc (spreadsheets), Impress (presentations), Draw (vector graphics and flowcharts), Base (databases), and Math (formula editing). Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity. LibreOffice is a powerful and free office suite, a successor to OpenOffice(.org), used by millions of people around the world. In this tutorial, we'll show you how to convert an Office Word document to PDF with the LibreOffice CLI in Ubuntu 20.04, in both desktop and server versions. The most popular ones and the ones you will probably end up using are Word documents and PDFs. In some applications, it will be necessary to automatize the conversion of documents between different formats.
