pdftools_toolbox.pdf.annotations.custom_stamp

Classes

CustomStamp(handle)

A stamp annotation with custom content

class pdftools_toolbox.pdf.annotations.custom_stamp.CustomStamp(handle)[source]

Bases: Stamp

A stamp annotation with custom content

static create(target_document: Document, bounding_box: Rectangle) CustomStamp[source]

Create a custom stamp annotation.

The returned custom stamp annotation’s appearance has an empty content with size equal to the given boundingBox, and with coordinate origin located at the bottom left corner. Use a pdftools_toolbox.pdf.content.content_generator.ContentGenerator to generate the stamp’s content prior to adding the stamp annotation to a page’s list of annotations.

Parameters:
Returns:

The newly created custom stamp annotation.

Return type:

pdftools_toolbox.pdf.annotations.custom_stamp.CustomStamp

Raises:
  • ValueError – if the targetDocument has already been closed

  • ValueError – if the targetDocument is read-only

property appearance: Group

The custom stamp’s visual appearance

Returns:

pdftools_toolbox.pdf.content.group.Group

Raises:

StateError – if the object has already been closed