Antiword serves as an ideal substitute for LibreOffice, running in the Terminal. It's the perfect choice for computers or systems that operate 'slowly' without the need for a graphic environment.
Continue reading Mytour's article below to explore how to use Antiword on Linux.
Antiword is compatible with various operating systems, including FreeBSD, BeOS, OS/2, Mac OS X, Amiga, VMS, NetWare, Plan9, EPOC, Zaurus PDA, MorphOS, Tru64/OSF, Minix, Solaris, and DOS.
1. Key Features of Antiword
Antiword allows users to view and convert MS Word documents from the command line. It supports conversion to the following formats:
- Plain text
- Text format
- PDF
- Postscript
- XML (only DocBook is supported)
2. Limitations of Antiword
The last update to Antiword was in 2005, and it does not support DOCX documents. Therefore, users cannot utilize Antiword for editing their documents.
3. Installing Antiword on Linux
If the Linux distribution you're using has an integrated package management system, you can search for Antiword in one of the repositories.
To acquire the compressed .tar.gz file, download it from the Antiword page on Freecode. Afterward, proceed to extract the file, navigate to the antiword-0.37 directory, and execute the following command:
make
sudo make install
4. Using Antiword on Linux
In the guides below, Mytour uses a resume example as a sample document. When you open this document in LibreOffice, it appears as follows:
The most basic use of Antiword is for display and opening documents:
antiword resume.doc
As you can see, the default command doesn't preserve document formatting such as font size, italics, and underlining, but the text appears more readable.
To display formatting information, we use the '-f' flag in the command:
antiword -f resume.doc
The command above doesn't show the true WYSIWYG format; rather, it displays markup-like syntax. For instance, underlined text appears as _underlined text_ and bold text with an asterisk *bold text*.
To convert a Word document to a PDF file, we need to specify the paper size using the '-a' flag. Antiword supports paper sizes including: 10x14, a3, a4, a5, b4, b5, folio, note, quarto, small, and tiny.
If desired, you can use the same paper size when converting to Postscript format using the '-p' flag.
For example, here's a conversion of the document to a small paper size PDF:
antiword -a tabloid resume.doc > resume-tabloid.pdf
Below is the resulting PDF file displayed in Okular:
Underlines and hyperlinks in email addresses are no longer present; overall, the conversion process has been successful.
If you wish to convert to Postscript, you can use '-L' to print in landscape mode.
The following example will convert the document to DocBook format:
antiword -x db resume.doc > resume-docbook.docbook
The conversion process retains metadata, including author names and document creation dates. The raw XML format looks like the example below:
The DocBook file in LibreOffice appears as follows:
Although it may not resemble the original Word document, the file structure remains intact.
Using Antiword to convert Word files to DocBook format proves to be more effective than converting to XML format.
Mytour's article provides a guide on using Antiword on Linux. Additionally, readers can explore other Mytour articles to learn how to install Microsoft Office on Linux.
Explore an article on using Telegram on the Linux command line. As a popular cloud-based messaging application, using Telegram on the Linux command line offers a distinctive experience for Linux operating systems.
