I'm trying to print a word document from the command line, but I need to specify printing options that I would normally use lpr for. This is the command I'm using
libreoffice -p "filename.doc"
I need to be able to specify a username (-U), is this possible? The following doesn't work
libreoffice -p "filename.doc" -U username
Should this work, or is there another way?
Best Answer
You can't pass
lpr
command line options tolibreoffice
. Two possible solutions are:One step solution (the best solution in my opinion): use unoconv outputting a PDF to
stdout
piped tolpr
:Three step solution (if you don't want / can't use
unoconv
): uselibreoffice --print-to-file
to a temporary file +lpr
of the file + delete the temporary file (unfortunatelly libreoffice still doesn't support printing to stdout):