Skip to main content
Version: API v2 Preview

BezierBuilder

Kind: class
Module/package: path_builder
SDK: pdfdancer-client-python 2.0.0

Builder class for constructing Bezier curve objects with fluent interface. Mirrors the Java client BezierBuilder API.

Declaration

BezierBuilder(client: "'PDFDancer'", page_number: 'int')

Members

__init__

__init__(self, client: "'PDFDancer'", page_number: 'int')

Initialize the bezier builder.

Args: client: The PDFDancer instance for adding the bezier page_number: The page number (1-indexed)

add

add(self) -> 'bool'

Build the bezier curve and add it to the PDF document.

Returns: True if successful

Raises: ValidationException: If required properties are missing

control_point_1

control_point_1(self, x: 'float', y: 'float') -> "'BezierBuilder'"

Set the first control point (absolute page coordinates).

Args: x: X coordinate on the page y: Y coordinate on the page

Returns: Self for method chaining

control_point_2

control_point_2(self, x: 'float', y: 'float') -> "'BezierBuilder'"

Set the second control point (absolute page coordinates).

Args: x: X coordinate on the page y: Y coordinate on the page

Returns: Self for method chaining

dash_pattern

dash_pattern(self, dash_array: 'List[float]', dash_phase: 'float' = 0.0) -> "'BezierBuilder'"

Set a dash pattern.

Args: dash_array: List of on/off lengths (e.g., [10, 5] = 10pt on, 5pt off) dash_phase: Offset into the pattern

Returns: Self for method chaining

fill_color

fill_color(self, color: 'Color') -> "'BezierBuilder'"

Set the fill color.

Args: color: The fill color

Returns: Self for method chaining

from_point

from_point(self, x: 'float', y: 'float') -> "'BezierBuilder'"

Set the starting point of the curve (absolute page coordinates).

Args: x: X coordinate on the page y: Y coordinate on the page

Returns: Self for method chaining

solid

solid(self) -> "'BezierBuilder'"

Set curve to solid (no dash pattern).

Returns: Self for method chaining

stroke_color

stroke_color(self, color: 'Color') -> "'BezierBuilder'"

Set the stroke color.

Args: color: The stroke color

Returns: Self for method chaining

stroke_width

stroke_width(self, width: 'float') -> "'BezierBuilder'"

Set the stroke width.

Args: width: The stroke width in points

Returns: Self for method chaining

to_point

to_point(self, x: 'float', y: 'float') -> "'BezierBuilder'"

Set the ending point of the curve (absolute page coordinates).

Args: x: X coordinate on the page y: Y coordinate on the page

Returns: Self for method chaining

View source at af2a1171a1b9