I'm attempting to come up with some means of converting .pptx
files to a PDF format from the command line. I have set up a cups-pdf
printer to which I can actually send jobs, and so far I have it boiled down to the following command:
libreoffice -pt PDF somePowerpointFilePath.pptx
where PDF
is the name of my printer. As is, however, libreoffice prints my documents in portrait orientation when I would like to use landscape.
I've taken a look at these questions, but none of them seem to suit my needs here.
https://superuser.com/questions/486130/printing-from-the-command-line-with-libreoffice-lpr-commands
https://superuser.com/questions/135495/how-do-i-convert-this-filetype-to-pdf
I have also read about the unoconv
options, but I'd rather not have to play with my Python libraries to get this set up.
I also noticed the --convert-to
option for the libreoffice
command, but it is not behaving how I expect it to. I expect to be able to use that by libreoffice --convert-to pdf myFileName.pptx
, but this command runs in no time at all (telling whenever you're working with libreoffice), and doesn't appear to deposit any sort of pdf file in the current working directory (as it is supposed to according to the man page).
If anyone can shed any light on how to get either of these two approaches working (printing through CUPS or using the --convert-to
option), I would appreciate it.
echo *.pptx | xargs -L 1 libreoffice --headless --convert-to pdf {}
, without need for the second step of printing the file again withlp
to correct orientation. It was probably an idiotic mistake on my end, specifying some of the syntax incorrectly forlibreoffice
. What's the best etiquette for closing this question in this situation? Should I delete it? If I have a guess as to what I was doing wrong, should I post it as an answer?