<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN' 'http://www.docbook.org/xml/4.5/docbookx.dtd'
[
    <!ENTITY p 'djvu2hocr'>
    <!ENTITY version '0.10'>
]>

<refentry>

<refentryinfo>
    <title>&p; manual</title>
    <productname>&p;</productname>
    <author>
        <firstname>Jakub</firstname> <surname>Wilk</surname>
        <email>jwilk@jwilk.net</email>
    </author>
</refentryinfo>

<refmeta>
    <refentrytitle>&p;</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo class='version'>&version;</refmiscinfo>
</refmeta>

<refnamediv>
    <refname>&p;</refname>
    <refpurpose>DjVu to hOCR converter</refpurpose>
</refnamediv>

<refsynopsisdiv>
    <cmdsynopsis>
        <command>&p;</command>
        <arg choice='opt' rep='repeat'><replaceable>option</replaceable></arg>
        <arg choice='plain'><replaceable>djvu-file</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
        <command>&p;</command>
        <group choice='req'>
            <arg choice='plain'><option>--version</option></arg>
            <arg choice='plain'><option>--help</option></arg>
            <arg choice='plain'><option>-h</option></arg>
        </group>
    </cmdsynopsis>
</refsynopsisdiv>

<refsection>
    <title>Description</title>
    <para>
        &p; converts hidden text from a DjVu file to the
        <ulink url='https://docs.google.com/View?docid=dfxcv4vc_67g844kf'>hOCR</ulink> format.
    </para>
</refsection>

<refsection>
    <title>Options</title>
    <refsection>
        <title>Input selection options</title>
        <variablelist>
        <varlistentry>
            <term><option>-p</option></term>
            <term><option>--pages=<replaceable>page-range</replaceable></option></term>
            <listitem>
                <para>
                    Specifies pages to covert. <replaceable>page-range</replaceable> is a comma-separated list of
                    sub-ranges. Each sub-range is either a single page (e.g. <literal>17</literal>) or a contiguous
                    range of pages (e.g. <literal>37-42</literal>). Pages are numbered from 1.
                </para>
                <para>
                    The default is to convert all pages.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Text segmentation options</title>
        <variablelist>
        <varlistentry>
            <term><option>--word-segmentation=simple</option></term>
            <listitem>
                <para>
                    Use the same word segmentation as found in the DjVu file.
                </para>
                <para>
                    This is the default.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><option>--word-segmentation=uax29</option></term>
            <listitem>
                <para>
                    Use the <ulink url='http://unicode.org/reports/tr29/'>Unicode Text Segmentation</ulink> algorithm
                    to break lines into words, possibly fixing word segmentation found in the DjVu file.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>HTML output options</title>
        <variablelist>
        <varlistentry>
            <term><option>--title=<replaceable>title</replaceable></option></term>
            <listitem>
                <para>
                    Specifies the document title.
                </para>
                <para>
                    The default is <quote>DjVu hidden text layer</quote>.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><option>--css=<replaceable>style</replaceable></option></term>
            <listitem>
                <para>
                    Add the specified CSS style to the document.
                </para>
                <para>
                    For example, <option>--css='.ocrx_line { display: block; }'</option> can be used to visually
                    preserve line breaks.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Other options</title>
        <variablelist>
        <varlistentry>
            <term><option>--version</option></term>
            <listitem>
                <para>Output version information and exit.</para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><option>-h</option></term>
            <term><option>--help</option></term>
            <listitem>
                <para>Display help and exit.</para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsection>
</refsection>

<refsection>
    <title>Portability</title>
    <para>
        &p; uses a custom extension to hOCR to retain characters which cannot be directly represented in an HTML/XML
        document. For example, control character BEL (^G, U+0007), is converted into the following HTML chunk:
        <computeroutput><![CDATA[<span class="djvu_char" title="#x07"> </span>]]></computeroutput>
    </para>
</refsection>

<refsection>
    <title>Bugs</title>
    <para>
        Please report bugs at:
        <ulink url='https://bitbucket.org/jwilk/ocrodjvu/issues'/>
    </para>
</refsection>

<refsection>
    <title>See also</title>
    <para>
        <citerefentry>
            <refentrytitle>djvu</refentrytitle>
            <manvolnum>1</manvolnum>
        </citerefentry>,
        <citerefentry>
            <refentrytitle>hocr2djvused</refentrytitle>
            <manvolnum>1</manvolnum>
        </citerefentry>,
        <citerefentry>
            <refentrytitle>ocrodjvu</refentrytitle>
            <manvolnum>1</manvolnum>
        </citerefentry>
    </para>
</refsection>

</refentry>

<!-- vim:set ts=4 sts=4 sw=4 tw=120 et: -->
