[opensource] Printing files from the command line

Brian Swaney swaney.29 at osu.edu
Fri Feb 6 17:30:19 EST 2009

OpenOffice 3 converts .doc and .docx files into PDF, along with a few 
other formats. If you are willing/able to use OpenOffice 
(non-command-line program) to print, then you should be able to use the 
PDF converter to get your desired postscript.

I don't know of any command-line utilities for reading Microsoft Office 
format files.

-Brian Swaney

Aaron Joseph wrote:
> I know that you can print files from the command line using 'lp' 
> command. But doing so requires a file to first be in ps format. I also 
> know that using 'pdf2ps' will convert a pdf file into the proper 
> format for printing. But what about printing .doc, .docx, 
> .anything_other_than_pdf  formatted files?
> My thought was to use the following algorithm:
> (1) convert file to pdf
> (2) convert pdf 2 ps using pdf2ps
> (3) send to printer using lp
> (4) Delete pdf and ps file (if not using pipes to pass things around)
> It requires an extra step (converting to pdf) but I figured it was the 
> most likely to work since printing to pdf is usually an option if you 
> were using any program.
> I've got the steps (2)-(4) working without any problems using a simple 
> bash script. But does anyone know how to accomplish step (1) from a 
> command line? I'll also accept answers that tell me how to go directly 
> from any file format to ps or ones that tell me a way to send any file 
> format directly to the printer without ever needing do any conversions 
> at all.
> --Aaron Joseph
> ------------------------------------------------------------------------
> _______________________________________________
> Opensource mailing list
> Opensource at cse.ohio-state.edu
> http://mail.cse.ohio-state.edu/mailman/listinfo/opensource
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3250 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.cse.ohio-state.edu/mailman/private/opensource/attachments/20090206/235bdd04/smime.bin

More information about the Opensource mailing list