[cups.general] print .doc with lp

Paul Ortman portman at goshen.edu
Wed May 30 14:32:50 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nathan Wheeler wrote:
> I'm trying to print a MS .doc just by using `lp -d printer file.doc`, 
> but it doesn't print the document, just some garbled text. I can print 
> just fine from word or openoffice, but not command line. Is there a way 
> to do this? Do I need to change mime.types or mime.convs or any filters? 
> Maybe I could convert the file first, like to PS or an image. Any advice?

You hit the nail on the head.  You'd be best served by converting the
..doc to PS and then printing that via lp.  There are a number of
converters our there (all with some limitation), but you might try
experimenting creating a simple "printdoc" script that uses something
like Abiword scripting to load the given .doc and then print the file
file out in PS format.

# abiword -p '| lpr -P myprinter' somedocument.doc

It won't be perfect in all cases, but it might be good enough for you.

There are probably a lot of other options out there that might use some
other .doc capable program, like OpenOffice, but I'll leave the Googling
up to you.

I imagine you could even hook something like this command up in a custom
CUPS filter, but since it will never really print exactly like Word
formats it, it will be a bit disappointing to those who can't appreciate
the technical difficulty of printing .doc files without documentation.

- --
Paul Ortman

PGP Key: 55602C81
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGXe17fw8KGlVgLIERAgrRAJ4kqwFeaJsuZa8DHVaUHMjP3iunvgCfWX3+
Qc4d8NZHh4DY/44TkspgYW0=
=XDaA
-----END PGP SIGNATURE-----





More information about the cups mailing list