Git Product home page Git Product logo

xdwlib's Introduction

Xdwlib README

2022-01-30 HAYASHI Hideki <[email protected]>

Welcome to the xdwlib source release

Xdwlib is a DocuWorks library for Python.

This document provides some general information about xdwlib source release. Detailed description is available in docs/ only in Japanese at the moment.

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.rst'. Send your feedback about the license to the author.

Installation

System Requirements

  • Microsoft Windows (versions compatible with DocuWorks 7+)
  • Python 3.7+
  • DocuWorks 7+ (Japanese version; English version may also work)

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 cx_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!

xdwlib's People

Contributors

hayasix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.