Skip to content

Line ​

Defined in: components/line.ts:13

Implements ​

Constructor components/line.ts:20 ​

new Line(options?): Line

Parameters ​

ParameterType
options?LineOptions

Returns ​

Line

Properties ​

PropertyModifierType
color?
line.ts:14
publicstring | Color
dash?
line.ts:16
publicnumber[] | "solid" | "dashed" | "dotted"
dashPhase?
line.ts:17
publicnumber
height?
line.ts:18
publicnumber
thickness?
line.ts:15
publicnumber

Methods ​

draw() components/line.ts:34 ​

draw(writer, x, y, width, availableHeight, context): Component | null

Draws the component (or a part of it) on the page.

Parameters ​

ParameterTypeDescription
writerPDFPageWriterThe page writer to issue commands to.
xnumberThe current relative X coordinate from the left margin.
ynumberThe current relative Y coordinate from the bottom margin (top boundary of the element).
widthnumberThe width constraint allocated to this element.
availableHeightnumberThe height constraint representing remaining space on the current page.
contextLayoutContextThe layout configuration context.

Returns ​

Component | null

A new Component representing the remainder of this component if it could not finish rendering, or null if it rendered completely.

Implementation of ​

Component.draw

measure() components/line.ts:28 ​

measure(width, context): object

Returns the width and height required by this component when rendered within a given width constraint.

Parameters ​

ParameterType
widthnumber
contextLayoutContext

Returns ​

object

NameType
height
line.ts:28
number
width
line.ts:28
number

Implementation of ​

Component.measure

Released under the MIT License.