77

I have a folder containing a bunch of ppts, each of which I'd like to convert to an individual pdf.

2
  • 1
    I think you meant "a folder containing a bunch of ppts" not pdfs. Nov 3, 2010 at 12:35
  • 1
    Your question need better explanation. Are you trying to convert each ppt to a pdf, or all the ppts to a single pdf with different pages, or ...?
    – frabjous
    Nov 3, 2010 at 18:06

4 Answers 4

95

You can also use the command line of libreoffice for your purpose. This example converts all ppt-files in the current directory to pdf's:

libreoffice --headless --invisible --convert-to pdf *.ppt  

--headless
Starts in "headless mode", which allows using the application without a user interface.
This special mode can be used when the application is controlled by external clients via the API...
It implies --invisible and strictly ignores any GUI environment.

and

--invisible
Starts in invisible mode.
Neither the start-up logo nor the initial program window will be visible. LO can be controlled and documents and dialogs can be opened via the API.
When started with this parameter, it can only be quit using the taskmanager (Windows) or the kill command (UNIX based systems).

Get more information on command line options with:

man libreoffice

(Note: You have to close all running instances of LibreOffice before the command line works.)

16
  • 2
    This solved my problem. Feb 27, 2012 at 23:10
  • 9
    It's awesome that libreoffice has the --convert-to option, but it sucks that it doesn't say anywhere that you also have to pass --headless and --invisible for it to work. +1 for the answer.
    – scribu
    Jun 9, 2012 at 0:01
  • 6
    --headless implies --invisible (at least on LO 3.4). Add -env:UserInstallation="file://$HOME/.libreoffice-alt" to work even with GUI instances running (credit here). Dec 13, 2012 at 20:04
  • (: - Amazing! - :)
    – desgua
    Feb 23, 2013 at 19:27
  • 2
    FWIW, on MacOS, libreoffice binary is called soffice and is located in /Applications/LibreOffice.app/Contents/MacOS
    – ijoseph
    Sep 12, 2017 at 18:41
52

You can use unoconv. It's available in the repositories, so you can just apt-get it: unoconv (direct install link)

Note that the info in the web page is outdated. Use man or type unoconv -h to get actual command line options. It works like this:

unoconv -f pdf presentation.odt

This command will create a presentation.pdf file.

I have only used it to batch convert ods to pdf and it works perfectly. I haven't tried it with presentations (but for a quick test now), but I expect that it will work nicely.

Note that it will not work on Lucid (10.04), because of a bug in the python-openoffice biddings. If you need to use it on Lucid, you can add this ppa to your software sources to upgrade your Openoffice version.

5
  • 1
    Your example uses the wrong command (uniconv instead of unoconv) Nov 3, 2010 at 12:36
  • 1
    That gives this error: Leaking python objects bridged to UNO for reason pyuno runtime is not initialized, (the pyuno.bootstrap needs to be called before using any uno classes) Segmentation fault
    – James
    Nov 4, 2010 at 1:01
  • 1
    @James: Yes, I checked it on 10.04 and it gives that error. A little googling shows that there is a bug in the Openoffice version shipped with Lucid. It works on Maverick (10.10) and Hardy (8.04), the versions that I use. Nov 4, 2010 at 9:35
  • 1
    For anyone wondering how to convert a folder containing any type of documents (*.txt, *.docx, *.pptx and even *.pdf etc) to PDFs : unoconv -f pdf <input-folder-path>/* --output <output-folder-path>/* Dec 10, 2018 at 15:04
  • Thanks a lot, this is a great solution! Oct 16, 2021 at 16:19
3

The easiest way to convert .ppt files to PDF is to install unoconv through the command line:

sudo apt-get install unoconv

Then open the terminal from the drive where the ppt files are available. Now type:

unoconv -f [format] pdf  filename.ppt

That's all. Done.

2
  • Welcome to AskUbuntu, This is a Q&A site not a forum. Thank you sharing knowledge but no need to duplicate answers. The high voted answer already mentioned unoconv tool.
    – user.dz
    Jan 1, 2017 at 9:41
  • Thank you (y) (y) (y) Jul 30, 2020 at 10:39
-1

There is an easy cheat.

Use unoconv with midnight commander to convert odt to pdf:

  • launch mc
  • navigate where the odt files are
  • tag odt files using Ctrl-T then F2,@,
  • paste in unoconv -f pdf

It will spew a bunch of dire error messages, but it works!

0

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