pdftools_toolbox.pdf.annotations.ellipse_annotation
Classes
|
An ellipse drawing annotation |
- class pdftools_toolbox.pdf.annotations.ellipse_annotation.EllipseAnnotation(handle)[source]
Bases:
DrawingAnnotationAn ellipse drawing annotation
- static create(target_document: Document, bounding_box: Rectangle, stroke: Stroke | None, fill: Paint | None) EllipseAnnotation[source]
Create an ellipse annotation.
The returned ellipse annotation is not yet part of any page. It can be added to a page’s list of annotations.
- Parameters:
targetDocument (pdftools_toolbox.pdf.document.Document) – The output document with which the returned object is associated.
boundingBox (pdftools_toolbox.geometry.real.rectangle.Rectangle) – The location on the page.
stroke (Optional[pdftools_toolbox.pdf.content.stroke.Stroke]) – The stroking parameters used for stroking the ellipse. The stroking paint is used as the annotation’s main paint. If None then the ellipse is not stroked.
fill (Optional[pdftools_toolbox.pdf.content.paint.Paint]) – The paint used for filling the ellipse. If None then the ellipse is not filled.
- Returns:
The newly created ellipse annotation.
- Return type:
pdftools_toolbox.pdf.annotations.ellipse_annotation.EllipseAnnotation
- Raises:
ValueError – if the targetDocument has already been closed
ValueError – if the targetDocument is read-only
ValueError – if the stroke and fill arguments are both None
ValueError – if the stroke argument is not associated with targetDocument
ValueError – if the stroke’s
pdftools_toolbox.pdf.content.stroke.Stroke.painthas apdftools_toolbox.pdf.content.paint.Paint.color_spaceother than a device color spaceValueError – if the stroke’s
pdftools_toolbox.pdf.content.stroke.Stroke.painthas a non-Nonepdftools_toolbox.pdf.content.paint.Paint.transparencywithpdftools_toolbox.pdf.content.transparency.Transparency.blend_modeother thanpdftools_toolbox.pdf.content.blend_mode.BlendMode.NORMALValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.line_cap_styleis other thanpdftools_toolbox.pdf.content.line_cap_style.LineCapStyle.BUTTValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.line_join_styleis other thanpdftools_toolbox.pdf.content.line_join_style.LineJoinStyle.MITERValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.miter_limitis other than 10ValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.dash_phaseis other than 0ValueError – if the fill has a
pdftools_toolbox.pdf.content.paint.Paint.color_spaceother than a device color spaceValueError – if the fill has a non-None
pdftools_toolbox.pdf.content.paint.Paint.transparencywithpdftools_toolbox.pdf.content.transparency.Transparency.blend_modeother thanpdftools_toolbox.pdf.content.blend_mode.BlendMode.NORMALValueError – if the fill argument is not associated with targetDocument
- property fill: Paint
The filling paint
- Returns:
pdftools_toolbox.pdf.content.paint.Paint
- Raises:
StateError – if the object has already been closed