[opensource] Printing files from the command line

Mark Haffner kc8khl at arrl.net
Fri Feb 6 19:02:44 EST 2009

I don't know of any program that will allow you to convert a full word
doc from the command line, but if you only care about the text you can
check out antiword. I don't believe that anyone has updated it to do
docx files but it does doc files fine. Spits out a bit of text. You
don't really need to PDF it you could just lp the text file if you
printer plays nice. 

Mark Haffner

On Fri, Feb 06, 2009 at 05:17:32PM -0500, 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

More information about the Opensource mailing list