I believe that everybody came across the need to convert some Microsoft Office document into PDF format. Under GNU/Linux this can be accomplished very simply.
If you are a student and all the courses are in PowerPoint and you want to read them as PDF under GNU/Linux using the awesome evince, then you will appreciate this tutorial. ( Question to the reader: Why does Evince look so good, while the GNU/Linux version of Acrobat Reader is so sluggish ?)
Steps to follow:
1) Install OpenOffice
2) Install Cups-PDF:
-
sudo apt-get install cups-pdf (Ubuntu)
-
sudo yum install cups-pdf (Fedora)
3) Create a PDF directory in your home directory if it doesn’t exist:
-
mkdir ~/PDF
4) For converting a single *.ppt file to *.pdf you should use:
-
soffice -norestore -nofirststartwizard -nologo -headless -pt PDF your_pdf_file.ppt
But this can be achieved easily using OpenOffice GUI.
Now I will show you how easy is to convert all the files in a directory to PDF files and then merge them in a single PDF file. You just have to go to the directory containing your files and then execute :
-
find . -type f -name "*.ppt" -exec soffice -norestore -nofirststartwizard -nologo -headless -pt PDF {} \;
Find will search in the current directory for all the files (due to “-type f”) and having the extension ppt (due to -name “*.ppt”) and convert them into PDF files.
You might also use *.doc (Microsoft Word), and i think (not tested) that also *.pptx and *.docx (Microsoft Office 2007) could be used. The output files will be stored in the ~/PDF directory.
Now the PDF merging stage. There are many tools that can do this under Linux, but I prefer pdftk which can be installed using:
-
sudo apt-get install pdftk (Ubuntu)
-
sudo yum install pdftk (Fedora)
And here is the easiest way to merge all the PDF files in a directory:
-
pdftk *.pdf output merged.pdf
where merged.pdf is the name of the merged file
).