Skip to main content
Version: API v2 Preview

Line

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

Straight line segment between two points.

Parameters:

  • p0: Start point.
  • p1: End point.

Example:

from pdfdancer.models import Line, Point, Path

line = Line(p0=Point(10, 10), p1=Point(100, 10))
path = Path(path_segments=[line])

Declaration

Line(stroke_color: pdfdancer.models.Color | None = None, fill_color: pdfdancer.models.Color | None = None, stroke_width: float | None = None, dash_array: List[float] | None = None, dash_phase: float | None = None, p0: pdfdancer.models.Point | None = None, p1: pdfdancer.models.Point | None = None) -> None

Members

__init__

__init__(self, stroke_color: pdfdancer.models.Color | None = None, fill_color: pdfdancer.models.Color | None = None, stroke_width: float | None = None, dash_array: List[float] | None = None, dash_phase: float | None = None, p0: pdfdancer.models.Point | None = None, p1: pdfdancer.models.Point | None = None) -> None

Initialize self. See help(type(self)) for accurate signature.

get_dash_array

get_dash_array(self) -> List[float] | None

Dash pattern for stroking the path segment. Null or empty means solid line.

get_dash_phase

get_dash_phase(self) -> float | None

Dash phase (offset) into the dash pattern in user space units.

get_fill_color

get_fill_color(self) -> pdfdancer.models.Color | None

Color used for filling the segment's interior area (if applicable).

get_p0

get_p0(self) -> pdfdancer.models.Point | None

Returns the starting point of this line segment.

get_p1

get_p1(self) -> pdfdancer.models.Point | None

Returns the ending point of this line segment.

get_stroke_color

get_stroke_color(self) -> pdfdancer.models.Color | None

Color used for drawing the segment's outline or stroke.

get_stroke_width

get_stroke_width(self) -> float | None

Width of the stroke line in PDF coordinate units.

View source at af2a1171a1b9