pdftools_toolbox.pdf.content.paint

Classes

Paint(handle)

class pdftools_toolbox.pdf.content.paint.Paint(handle)[source]

Bases: _NativeObject

static create(target_document: Document, color_space: ColorSpace, color: List[float], transparency: Transparency | None) Paint[source]

Create an new paint.

Transparency is supported by PDF 1.4 or higher and by PDF/A-2 or higher. The returned paint object is not yet used on any page, but it is associated with the given target document.

Parameters:
Returns:

newly created paint object

Return type:

pdftools_toolbox.pdf.content.paint.Paint

Raises:
property color_space: ColorSpace

The color space of this paint.

Returns:

pdftools_toolbox.pdf.content.color_space.ColorSpace

Raises:
  • StateError – the object has already been closed

  • StateError – the object has been created with any creation method of the document.

property color: List[float]

The color values of this paint.

Returns:

List[float]

Raises:
  • StateError – the object has already been closed

  • StateError – the object has been created with any creation method of the document.

property transparency: Transparency | None

The transparency parameters of this paint or None if this paint is opaque.

Returns:

Optional[pdftools_toolbox.pdf.content.transparency.Transparency]

Raises:
  • StateError – the object has already been closed

  • StateError – the object has been created with any creation method of the document.