pdftools_toolbox.pdf.annotations.ink_annotation
Classes
|
A free-hand drawing annotation |
- class pdftools_toolbox.pdf.annotations.ink_annotation.InkAnnotation(handle)[source]
Bases:
DrawingAnnotation
A free-hand drawing annotation
- static create(target_document: Document, path: Path, stroke: Stroke) InkAnnotation [source]
Create a ink annotation.
The returned ink 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.
path (pdftools_toolbox.pdf.content.path.Path) – The path of the free-hand drawing.
stroke (pdftools_toolbox.pdf.content.stroke.Stroke) – The stroking parameters used for stroking the line. The stroking paint is used as the annotation’s main paint.
- Returns:
The newly created ink annotation.
- Return type:
pdftools_toolbox.pdf.annotations.ink_annotation.InkAnnotation
- Raises:
ValueError – if the targetDocument has already been closed
ValueError – if the targetDocument is read-only
ValueError – if the path argument has not been constructed with a
pdftools_toolbox.pdf.content.path_generator.PathGenerator
ValueError – if the targetDocument’s conformance is not PDF 2.0 and the path argument contains curve-to operations
ValueError – if the path argument contains rectangle operations
pdftools_toolbox.unsupported_feature_error.UnsupportedFeatureError – if the targetDocument’s conformance is PDF 2.0 and the path argument contains curve-to operations
ValueError – if the stroke’s
pdftools_toolbox.pdf.content.stroke.Stroke.paint
has apdftools_toolbox.pdf.content.paint.Paint.color_space
other than a device color spaceValueError – if the stroke’s
pdftools_toolbox.pdf.content.stroke.Stroke.paint
has a non-Nonepdftools_toolbox.pdf.content.paint.Paint.transparency
withpdftools_toolbox.pdf.content.transparency.Transparency.blend_mode
other thanpdftools_toolbox.pdf.content.blend_mode.BlendMode.NORMAL
ValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.line_cap_style
is other thanpdftools_toolbox.pdf.content.line_cap_style.LineCapStyle.BUTT
ValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.line_join_style
is other thanpdftools_toolbox.pdf.content.line_join_style.LineJoinStyle.MITER
ValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.miter_limit
is other than 10ValueError – if the stroke argument’s dash array is not empty
ValueError – if the stroke argument’s
pdftools_toolbox.pdf.content.stroke.Stroke.dash_phase
is other than 0ValueError – if the stroke argument is not associated with the targetDocument