Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print Microsoft Word docs using cups/lp/lpr?

1,393 views
Skip to first unread message

Alan Meyer

unread,
Jul 19, 2012, 12:00:23 PM7/19/12
to
Ladies and Gentlemen:

I am working on a project that needs to print batches of user uploaded
documents from time to time. Some of these documents are in Microsoft
Word format.

Does anyone know a good way to print a Microsoft Word doc in batch on
Linux, without using Word and Windows?

If I can't find a program to directly print a Word doc, the next best
thing would be a program that batch converts the Word doc to something
else that's easy to print, like PostScript or PDF. Format inaccuracies
in the conversion are probably tolerable, as long as they don't mangle
the content but, obviously, the more accurate the conversion the better.

As a last resort, I could ask the users to save a copy of the document
as a PDF, and print that, but they need the Word doc too so it would be
an extra burden on them to save two versions and, if they make a
revision, again, remember to save two versions.

If anyone has any suggestions I'd love to hear them.

Thanks.

Alan

Krzysztof Mitko

unread,
Jul 19, 2012, 1:54:25 PM7/19/12
to
Libre Office can be run from terminal with -p option, try that.

--
Z pozdrowieniami,
Krzysztof Mitko

Alan Meyer

unread,
Jul 19, 2012, 4:30:57 PM7/19/12
to
On 7/19/2012 1:54 PM, Krzysztof Mitko wrote:

> Libre Office can be run from terminal with -p option, try that.

That is an outstanding suggestion! I didn't know lo could do that.

Thanks.

Alan


Robert Heller

unread,
Jul 19, 2012, 6:44:52 PM7/19/12
to
At Thu, 19 Jul 2012 12:00:23 -0400 Alan Meyer <ame...@yahoo.com> wrote:

>
> Ladies and Gentlemen:
>
> I am working on a project that needs to print batches of user uploaded
> documents from time to time. Some of these documents are in Microsoft
> Word format.
>
> Does anyone know a good way to print a Microsoft Word doc in batch on
> Linux, without using Word and Windows?

OpenOffice will, but it doesn't really work properly as a CLI program.
It does have a command line option to convert to PDF, but it hangs --
at least the version shipped with CentOS 5.8 (3.1.1). I think some
part of it is waiting on some part of the GUI, even when the GUI is
disabled via command line switches. It *used* to work properly, so I
think this is some sort of bug (and a newer version might be fixed).
OpenOffice is a *huge* program / package and depends on the GUI
subsystem and might not be something you really want to install on a
server. Oh, OpenOffice 3.1.1 can't open docx files. I don't know if a
newer version of OpenOffice can open them.

>
> If I can't find a program to directly print a Word doc, the next best
> thing would be a program that batch converts the Word doc to something
> else that's easy to print, like PostScript or PDF. Format inaccuracies
> in the conversion are probably tolerable, as long as they don't mangle
> the content but, obviously, the more accurate the conversion the better.

There is no program that can directly print a Word doc on Linux without
using a GUI (MS-Word or OpenOffice). Antiword can *sort* of do it, but
either tosses the formatting (converts it to *plain text*) or only
works if the document is NOT UTF (converts the *textual* part to
PostScript). Antiword also drops any imbedded figures. OTOH, grabing
the source code for Antiword (or OO) and writing a pure CLI program
would be another (but very non-trivial) option.


>
> As a last resort, I could ask the users to save a copy of the document
> as a PDF, and print that, but they need the Word doc too so it would be
> an extra burden on them to save two versions and, if they make a
> revision, again, remember to save two versions.

This is actually your only 100% working option, but heavily depends on
user cooperation.

>
> If anyone has any suggestions I'd love to hear them.

There really aren't going to be any good suggestions.

>
> Thanks.
>
> Alan
>

--
Robert Heller -- 978-544-6933 / hel...@deepsoft.com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments



Bob Tennent

unread,
Jul 20, 2012, 12:36:02 AM7/20/12
to
On Thu, 19 Jul 2012 12:00:23 -0400, Alan Meyer wrote:

> Does anyone know a good way to print a Microsoft Word doc in batch on
> Linux, without using Word and Windows?

http://dag.wieers.com/home-made/unoconv/

unoconv converts between any document format that OpenOffice
understands. It uses OpenOffice's UNO bindings for non-interactive
conversion of documents.

Supported document formats include Open Document Format (.odt), MS Word
(.doc), MS Office Open/MS OOXML (.xml), Portable Document Format (.pdf),
HTML, XHTML, RTF, Docbook (.xml), and more.

Bob Tennent

unread,
Jul 20, 2012, 12:57:03 AM7/20/12
to
On Thu, 19 Jul 2012 17:44:52 -0500, Robert Heller wrote:

> OpenOffice 3.1.1 can't open docx files. I don't know if a
> newer version of OpenOffice can open them.

I'm using LibreOffice-3.5.1.2 on Centos 6.3 and it opens .docx documents
just fine.

>> If anyone has any suggestions I'd love to hear them.
>
> There really aren't going to be any good suggestions.

Not from you.

Chris Davies

unread,
Jul 20, 2012, 4:10:51 AM7/20/12
to
Bob Tennent <Bo...@cs.queensu.ca> wrote:
> On Thu, 19 Jul 2012 12:00:23 -0400, Alan Meyer wrote:
> > Does anyone know a good way to print a Microsoft Word doc in batch on
> > Linux, without using Word and Windows?

> http://dag.wieers.com/home-made/unoconv/

> unoconv converts between any document format that OpenOffice
> understands.

Thank you for this, Bob. Another tool to my collection (and it's even
in the Debian repos :-)

Chris

Stefan Patric

unread,
Jul 20, 2012, 11:34:37 AM7/20/12
to
On Thu, 19 Jul 2012 17:44:52 -0500, Robert Heller wrote:

> At Thu, 19 Jul 2012 12:00:23 -0400 Alan Meyer <ame...@yahoo.com> wrote:
>>
>> I am working on a project that needs to print batches of user uploaded
>> documents from time to time. Some of these documents are in Microsoft
>> Word format.
>>
>> Does anyone know a good way to print a Microsoft Word doc in batch on
>> Linux, without using Word and Windows?
>
> OpenOffice will, but it doesn't really work properly as a CLI program.
> It does have a command line option to convert to PDF, but it hangs -- at
> least the version shipped with CentOS 5.8 (3.1.1). I think some part of
> it is waiting on some part of the GUI, even when the GUI is disabled via
> command line switches. It *used* to work properly, so I think this is
> some sort of bug (and a newer version might be fixed). OpenOffice is a
> *huge* program / package and depends on the GUI subsystem and might not
> be something you really want to install on a server. Oh, OpenOffice
> 3.1.1 can't open docx files. I don't know if a newer version of
> OpenOffice can open them.
>

OpenOffice 3.1.1 running under Fedora 12 64-bit opens docx files just
fine here. I do it all the time. Maybe, it's CentOS and not OO. Or,
maybe, OO is missing a plugin/converter.

Stef
0 new messages