=============
Xdwlib README
=============


Welcome to the xdwlib source release
====================================

Xdwlib is a DocuWorks library for Python.

This document provides some general information about xdwlib source release
and provides links to other documents.

General xdwlib information is available at https://launchpad.net/xdwlib/.
Japanese document is also available at http://xdwlib.linxs.org/.

Report problems with this release to xdwlib@linxs.org.

License
-------

Copyright (C) 2010 HAYASI Hideki <xdwlib@linxs.org>.  All rights reserved.

Xdwlib is provided under The Zope Public License (ZPL) Version 2.1, which is
included in 'LICENSE'.  Send your feedback about the license to
xdwlib@linxs.org.


Installation
============

System Requirements
-------------------

    - Microsoft Windows (versions compatible with DocuWorks 7.0)

    - Python 2.6+

    - DocuWorks 7.0+ (Japanese version; English version is not tested yet)

Install from archive
--------------------

Set PATH environment variable properly and issue the following command::

    python setup.py install

This will install xdwlib in $PYTHONPATH/xdwlib.

Install from PyPI
-----------------

Xdwlib is also delivered via Python Package Index (PyPI).  The latest
version of xdwlib will be installed by issuing::

    pip install xdwlib

If you have installed older version of xdwlib already, try::

    pip install --upgrade xdwlib

Optional Modules
----------------

Xdwlib works with PIL (Python Imaging Library) if available,
to rotate pages for desired degrees other than right angles, and to copy
bitmap annotations.

Install PIL by issuing::

    pip install pil

Typical Use
===========

The following code will appy OCR and paste a date stamp on every page
as an annotation::

    import time

    from xdwlib import xdwopen, Point

    ...

    with xdwopen(PATHNAME, autosave=True) as doc:
        position = Point(pg.size - 100, pg.size - 20)
        datestamp = time.strftime("%Y-%m-%d")
        for pg in doc:
            pg.rotate(auto=True)
            pg.ocr(strategy="accuracy")
            ann = pg.add_text(position=position, text=datestamp)
            ann.fore_color = "red"


Reporting bugs
==============

Bugs reports are welcome at xdwlib@linxs.org.


Have fun!
