Nokia N97 SDK
Example Applications Guide

Antiword Example

1. About this Example
2. Prerequisites
3. Design and Implementation
4. Usage details
5. Porting Log


1. About this Example

Antiword is a console-based apllication ported on the Openc, It serves the following purposes,

ANTIWORD can be used for the following purposes:


1.1 Building and Using

To build the Antiword example application, go to the Antiword\group directory and build the application.

The definition for the whole application can be found in the bld.inf file in the group subdirectory of the applications main directory.


2. Prerequisites

This example requires a familiarity with the C programming language, and access to the Open C stanadard library documentation. As, this example uses Open C Standard library, the reader is recommended to read the following topics from the SDK documentation before proceeding:


3. Design and Implementation

3.1 Capabilities

The program capabilities are defined in:

antiword.mmp file (EXE - executable): CAPABILITY NONE

3.2 Implementation details of EXE

3.3 Limitations


4. Usage details

4.1 Options available

 - -f formatted text output
 - -t text output (default)
 - -a <paper size name> Adobe PDF output
 - -p <paper size name> PostScript output paper size like: a4, letter or legal
 - -x <dtd> XML output like: db (DocBook)
 - -m <mapping> character mapping file
 - -w <width> in characters of text output
 - -i <level> image level (PostScript only)
 - -L use landscape mode (PostScript only)
 - -r Show removed text
 - -s Show hidden (by Word) text

4.2 Example usecases

Note: Antiword takes the absolute paths for the input file and output file. the <src_path> and <dest_path> in the above example refers to the absolute path of the source and destination path respectively.

4.2.1 Examples

A sample word file sample.doc is kept in antiword/data directory and the same file is exported to the \epoc32\winscw\c directory, so that user can test the application with the following command strings.
    - antiword c:/sample.doc c:/sample.txt
    - antiword -w 20 c:/sample.doc c:/sample_w20.txt
    - antiword -f c:/sample.doc c:/sample_f.txt
    - antiword -a a4 c:/sample.doc c:/sample.pdf
    - antiword -p a4 c:/sample.doc c:/sample.ps
    - antiword -p a4 c:/sample.doc c:/sample.ps
    - antiword -x db c:/sample.doc c:/sample.xml
The generated files from the above operations are kept in the antiword\data\results folder for further reference.

5. Porting Log

As this is an OSS based application, porting it on top of Open C involves following steps.

  1. antiword-0.37.tar.gz is extracted and makefile is analyzed for the dependency.
  2. All .c files are recognized and put it under antiword/src folder.
  3. All .h files are recognized and put it under antiword/inc folder.
  4. group folder is created and bld.inf and mmp file is created.
  5. All the .c files are specified under the SOURCE tag and ../src is given as the source path.
  6. ../inc is given as USERINCLUDE path. and the open C's standard include path is given as SYSTEMINCLUDE.
  7. the data files [ i.e some character mapping files and font files ] are recognized and put it under antiword/data and all of this files are exported to a standard path [i.e /epoc32/winscw/c/antiword ] and the application is modified to consider this path as ANTIWORD_HOME folder.
  8. As some of the files dependent on the Linux sprite library, these things are removed from the mmp file. [ these files are kept in antiword/src just for reference, but these are commented in mmp file ].
  9. Application compiled easyly on top of OpenC after the above steps. It is just a day effort to make it compile on Open C.

Once the Application compiled, Application debugged on emulator and undergone several modifications to work on Open C. The following steps describes those modifications,

After the above changes, application start working on the emulator and with few changes [ like increasing the stack and heap size of the application ], Antiword starts generating pdfs, postscripts files successfully on the device.


© Nokia 2009

Back to top