- Text format
- PDF
- Postscript
- XML (only DocBook supported)
Antiword was last updated in 2005 and is not compatible with DOCX documents. Therefore, users cannot use Antiword to edit their documents.
If the Linux distribution you are using has a built-in package management system, you can search for Antiword in one of the repositories.
If not download the .tar.gz archive from the Antiword page on Freecode. Then extract the file, access the antiword-0.37 folder and run the command below:
make
sudo make install
In the instructions below TipsMake uses a resume example as a sample document. When opening this document in LibreOffice, it looks like this:
The most basic way to use Antiword is to display and open documents:
antiword resume.doc
As you can see, the default command doesn't preserve document formatting like font size, italics, and underlining, but the text looks more readable.
To display certain information, we use the "-f" flag in the command:
antiword -f resume.doc
The above command does not display the correct WYSIWYG format, rather it displays markup-like syntax. For example, underlined text it displays as _underlined text_ and bold text with an asterisk *bold text*.
To convert a Word document into a PDF file, we must specify the paper size using the "-a" flag. Antiword supports paper sizes including: 10x14, a3, a4, a5, b4, b5, folio, letter, note, quarto, small size.
If you want, you can use the same paper size when converting to Postscript documents by using the "-p" flag.
For example below, convert a document to small-sized PDF format:
antiword -a tabloid resume.doc > resume-tabloid.pdf
Below is the resulting PDF file displayed in Okular:
The underline and hyperlink in the email address are gone, overall the conversion was successful.
If you want to convert to Postscript, you can use "-L" to print in landscape mode.
The example below will convert the document to DocBook format:
antiword -x db resume.doc > resume-docbook.docbook
The conversion process preserves metadata, including author name and document creation date. The raw XML format looks like this:
DocBook files in LibreOffice have the following format:
Although it does not look similar to the original Word document, the file structure remains the same.
It can be seen that using Antiword to convert Word files to DocBook format works better than converting to XML format.
The above article TipsMake has just shown you how to use Antiword on Linux. In addition, readers can refer to some articles available on TipsMake to learn how to install Microsoft Office on Linux.
Refer to the article using Telegram on Linux command, this is a quite popular cloud-based messaging application, using Telegram on Linux command is a difference of the Linux operating system.