On Fri, Feb 18, 2011, Gregory P. Ennis wrote:
On 18/02/2011, at 2:29 PM, Gregory P. Ennis wrote:
Everyone,
I am trying to print some *.doc files from the command line with openoffice on centos 5.5 with using cups as the print server.
I can open the file from the command line with open office and then print it manually from the gui, but when I open the file and print from command line I am not getting anything.
The commands that I have used are the following :
/usr/bin/openoffice.org -pt lpt4 /mnt/lp/document.doc -terminate_after_init
This works for me on LibreOffice on my Mac (also uses Cups)
LibreOffice 3.3 330m12(Build:1)
/path/to/soffice -headless -pt PRINTER_NAME doco.doc
Note though that if you wanted to do this outside of X11, it might fail...
I tried this using NeoOffice on my Macbook Pro which doesn't use X11, but I expect that it would fail on Linux without X11 as it presents the normal print dialog box to select the printer even though it's set on the command line.
Answering the question below, I ran this in background, terminating the command with "&", which left NeoOffice running, but gave me the command line back so I could continue. This is not entirely a Bad Thing(tm) as it avoids the startup time when printing multiple documents.
On the other hand, having NeoOffice present the print dialog box for every file is less than optimal, but it looks like that's a NeoOffice thing.
I tried the same command with the path to the most recent OpenOffice.org soffice which didn't present the dialog box, and terminated after the print job was complete.
Trying this on a CentOS 5 box here it works fine running the job in background where it is ready to run subsequent print jobs. This does not present the print dialog box either. I ran this test in an xterm via ssh with X11 forwarding from my Macbook Pro.
Another test using 'xterm -e ssh -x' to disable X11 forwarding failed on startup saying it can't open DISPLAY. Running the command with 'ssh -Y user@system /path/to/soffice ...'' did work nicely, and did not leave soffice running on completion.
Cameron,
Thanks for your suggestion!!!!
On my system that command results in printing the document on the desired printer, but does not return back to the shell prompt. If I add -terminate_after_init so that the command line is :
openoffice.org -headless -pt lpt3 document.doc -terminate_after_init
The above command returns back to the prompt but the document is not printed.
Any other ideas would be appreciated!!!
Greg