Skip to main content

A DocuWorks library.

Project description

2021-11-15 HAYASHI Hideki <hideki@hayasix.com>

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://github.com/hayasix/xdwlib/ . Detailed description is available in docs/ only in Japanese at the moment, while every __doc__ property is written in English.

Report problems with this release to the author.

License

Copyright (C) 2010 HAYASHI Hideki

Xdwlib is provided under The Zope Public License (ZPL) Version 2.1, which is included in ‘LICENSE’. Send your feedback about the license to the author.

Installation

System Requirements

  • Microsoft Windows (versions compatible with DocuWorks 7 and 8)

  • Python 3.7+

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

Install from archive

Set PATH environment variable properly and issue the following command:

python3 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:

pip3 install xdwlib

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

pip3 install --upgrade xdwlib

Optional Modules

PIL (Python Imaging Library)

Xdwlib has been working with PIL (Python Imaging Library) if available, to rotate pages for desired degrees other than right angles, and to copy bitmap annotations. Unfortunately the original PIL has not been ported on Python 3 yet.

There is an alternative library called Pillow which will be a good substitution. Install Pillow by issuing:

pip3 install pillow

cx_Freeze

The attached command line tool xdw2text.py can be compiled to .exe with cx_Freeze package, a popular successor of py2exe. To build your own xdw2text.exe, try:

pip3 install cx_Freeze
python3 setup.py build

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

The author appreciate bugs reports from you by email.

Have fun!

Zope Public License (ZPL) Version 2.1

A copyright notice accompanies this license document that identifies the copyright holders.

This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF).

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer.

  2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders.

  4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders.

  5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

Disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ‘’AS IS’’ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xdwlib-3.8.5.1.zip (339.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page