3
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.
sometimes this will help you.
– Renju Chandran chingath – 2014-05-19T09:00:35.137I can achieve what you describe by means of libreoffice --headless --convert-to pdf mystuff.pptx; lp -d myprinter -o landscape mystuff.pdf. You should thus give us something more, dmesg output, error messages, log files, in order to understand what is going on. I repeat, these commands work perfectly on my system. – MariusMatutiae – 2014-05-20T09:07:26.940
Well, I can't replicate the issue (in my defense, 23 days). Thanks very much for the bounty and helpful comments, but I seem to be able to use
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? – matthugs – 2014-05-22T14:40:09.617
@matthugs Yes, you are encouraged to post answers to your own question if you have one. – Jason – 2014-05-22T20:37:47.773