Ignore:
Timestamp:
20 Feb 2013, 10:58:21 (12 years ago)
Author:
uli
Message:

Give some hints about usage of get_signature_tables().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py

    r9963 r9972  
    392392                         horizontal=None, single_table=False):
    393393    """Get a list of reportlab flowables representing signature fields.
     394
     395    `signatures` is a list of signatures. Each signature can be a
     396    simple string or a tuple of format::
     397
     398      (<PRE-TEXT>, <SIGNATURE>, <POST-TEXT>)
     399
     400    where ``<PRE-TEXT>`` and ``<POST-TEXT>`` are texts that should
     401    appear on top (PRE) or below (POST) the signature cell. Both
     402    formats, string and tuple, can be mixed. A single signature would
     403    be given as ``[('Pre-Text', 'Signature', 'Post-Text'),]`` or
     404    simply as ``['Signature']`` if not pre or post-text is wanted.
     405
     406    All texts (pre, sig, post) are rendered as paragraphs, so you can
     407    pass in also longer texts with basic HTML formatting like ``<b>``,
     408    ``<i>``, ``<br />``, etc.
     409
     410    ``lang`` sets the language to use in I18n context. All texts are
     411    translated to the given language (``en`` by default) if a
     412    translation is available.
     413
     414    ``max_per_row`` gives the maximum number of signatures to put into
     415    a single row. The default is 3. If more signatures are passed in,
     416    these signatures are put into a new row. So, for example by
     417    default 8 signatures would be spread over 3 rows.
     418
     419    ``horizontal`` tells how the single signature cells should be
     420    rendered: horizontal or vertical. While horizontal cells render
     421    date and signature fields side by side, in vertical cells date is
     422    rendered on top of the signature.
     423
     424    This parameter accepts *three* different values: ``True``,
     425    ``False``, or ``None``. While with ``True`` each cell is rendered
     426    in horizontal mode, ``False`` will create only vertical cells.
     427
     428    The ``None`` value (set by default) is different: if set, the mode
     429    will be dependent on the number of signatures per row. If a row
     430    contains exactly one signature (because only one sig was passed
     431    in, or because ``max_per_row`` was set to ``1``), then this
     432    signature is rendered in horizontal mode. Otherwise (with more
     433    than one sig per row) each cell is rendered in vertical mode. This
     434    pseudo-smart behaviour can be switched off by setting
     435    ``horizontal`` explicitly to ``True`` or ``False``.
     436
     437    ``single_table`` is a boolean defaulting to ``False``. By default
     438    we return the rows of a signature table in several tables, one of
     439    each row. This makes it easier for reportlab to perform pagebreaks
     440    in case the page is already full, without wasting space. If the
     441    parameter is set to ``True``, then always a list with exactly one
     442    table is returned, which will contain all rows in one table.
     443
     444    Generally, if a row contains only one signature, only a part of
     445    the page width is used to render this signature. If two or more
     446    signatures are passed in, the complete page width will be filled
     447    and the single signature cells will be shrinked to fit.
    394448    """
    395449    data_list = get_sig_tables(
     
    397451        horizontal=horizontal, single_table=single_table)
    398452    return [Table(row_data, style=row_style, colWidths=row_col_widths,
    399                   repeatRows=2)
     453                  repeatRows=4)
    400454            for row_data, row_style, row_col_widths in data_list]
    401455
Note: See TracChangeset for help on using the changeset viewer.