pdftools_sdk.sign.appearance

Classes

Appearance(handle)

The visual appearance of signatures

class pdftools_sdk.sign.appearance.Appearance(handle)[source]

Bases: _NativeObject

The visual appearance of signatures

A signature may have a visual appearance on a page of the document. The visual appearance is optional and has no effect on the validity of the signature. Because of this and because a visual appearance may cover important content of the page, it is recommended to create invisible signatures by default.

Typically, a visual appearance is created for forms with a dedicated area reserved for the appearance. Other transaction documents, e.g. invoices, correspondence, or bank statements, are usually signed without a visual appearance.

The appearance can be positioned on a page using pdftools_sdk.sign.appearance.Appearance.page_number , pdftools_sdk.sign.appearance.Appearance.top , pdftools_sdk.sign.appearance.Appearance.right , pdftools_sdk.sign.appearance.Appearance.bottom , and pdftools_sdk.sign.appearance.Appearance.left . It is recommended to set either pdftools_sdk.sign.appearance.Appearance.top or pdftools_sdk.sign.appearance.Appearance.bottom and pdftools_sdk.sign.appearance.Appearance.right or pdftools_sdk.sign.appearance.Appearance.left . If all are None, the default is to position the appearance in the lower right corner with 12 pt (1/6 inch or 4.2 mm) distance to the bottom and right edge of the page, i.e. Bottom = 12 and Right = 12.

static create_from_json(stream: IOBase) Appearance[source]

Create an appearance with the content loaded from a JSON file

The format of the JSON file is described in the user manual.

Parameters:

stream (io.IOBase) – The JSON file defining the content

Return type:

pdftools_sdk.sign.appearance.Appearance

Raises:
static create_from_xml(stream: IOBase) Appearance[source]

Create an appearance with the content loaded from an XML file

The format of the XML file is described in the user manual.

Parameters:

stream (io.IOBase) – The XML file defining the content

Return type:

pdftools_sdk.sign.appearance.Appearance

Raises:
static create_field_bounding_box(size: Size) Appearance[source]

Create the bounding box for an unsigned signature field

Unsigned signature fields can define a rectangle on a page. When the field is signed, the signer creates a visual appearance within that rectangle.

Parameters:

size (pdftools_sdk.geometry.units.size.Size) – The size of the rectangle

Return type:

pdftools_sdk.sign.appearance.Appearance

property page_number: int | None

The number of the page where the appearance is positioned

Page number must be in the range from 1 to pdftools_sdk.pdf.document.Document.page_count .

If None, the appearance is positioned on the last page.

Default is None

Returns:

Optional[int]

property top: float | None

Distance to top of page

This property specifies the distance between appearance’s top edge and the top of the page.

If None, the distance to the top is unspecified.

Default is None

Returns:

Optional[float]

property right: float | None

Distance to right of page

This property specifies the distance between appearance’s right edge and the right of the page.

If None, the distance to the right is unspecified.

Default is None

Returns:

Optional[float]

property bottom: float | None

Distance to bottom of page

This property specifies the distance between appearance’s bottom edge and the bottom of the page.

If None, the distance to the bottom is unspecified.

Default is None

Returns:

Optional[float]

property left: float | None

Distance to left of page

This property specifies the distance between appearance’s left edge and the left of the page.

If None, the distance to the left is unspecified.

Default is None

Returns:

Optional[float]

property custom_text_variables: CustomTextVariableMap

Maps the name of a custom text variable to its value. These variables can parametrize the content of the text element in the appearance configuration XML and Json files. They are used by setting “[custom:‹key›]”.

Returns:

pdftools_sdk.sign.custom_text_variable_map.CustomTextVariableMap