pdftools_toolbox.pdf.annotations.file_attachment

Classes

FileAttachment(handle)

A file attachment annotation

class pdftools_toolbox.pdf.annotations.file_attachment.FileAttachment(handle)[source]

Bases: MarkupAnnotation

A file attachment annotation

static create(target_document: Document, top_left: Point, attached_file: FileReference, paint: Paint) FileAttachment[source]

Create a file attachment annotation.

The returned file attachment annotation is not yet part of any page. It can be added to a page’s list of annotations.

Parameters:
Returns:

The newly created file attachment annotation.

Return type:

pdftools_toolbox.pdf.annotations.file_attachment.FileAttachment

Raises:
property icon: FileAttachmentIcon

The displayed icon

Returns:

pdftools_toolbox.pdf.annotations.file_attachment_icon.FileAttachmentIcon

Raises:
property paint: Paint

The paint for the icon and the popup

Returns:

pdftools_toolbox.pdf.content.paint.Paint

Raises:
property attached_file: FileReference

The embedded file

Returns:

pdftools_toolbox.pdf.file_reference.FileReference

Raises:

StateError – if the object has already been closed

property popup: Popup | None

The pop-up

Returns:

Optional[pdftools_toolbox.pdf.annotations.popup.Popup]

Raises:

StateError – if the object has already been closed