[]
        
(Showing Draft Content)

Pen

DsPdfJS API v9.1.0


DsPdfJS API / Pen

Class: Pen

Represents a pen used to draw lines and contours.

Extends

Constructors

Constructor

new Pen(penProperties): Pen

Creates a new Pen based on properties of an existing Pen.

Parameters

penProperties

PenProperties

The settings overriding properties of the base Pen.

Returns

Pen

Overrides

ObjectBase.constructor

Constructor

new Pen(basePen, penProperties): Pen

Creates a new Pen based on properties of an existing Pen.

Parameters

basePen

Pen

The Pen used as the base for the new Pen.

penProperties

PenProperties

The settings overriding properties of the base Pen.

Returns

Pen

Overrides

ObjectBase.constructor

Constructor

new Pen(om, penProperties): Pen

Creates a new Pen object with specified properties.

Parameters

om

ObjectManager

An object manager that controls the lifetime of the Pen object.

penProperties

PenProperties

The settings for creating a Pen.

Returns

Pen

Overrides

ObjectBase.constructor

Accessors

color

Get Signature

get color(): Color

Gets the pen color.

Returns

Color


dashOffset

Get Signature

get dashOffset(): number

Gets the distance within the dash pattern where a dash begins.

Returns

number


dashPattern

Get Signature

get dashPattern(): number[] | null

Gets the custom dash pattern of lines drawn with this pen.

Returns

number[] | null


dashStyle

Get Signature

get dashStyle(): DashStyle

Gets the style of dashed lines drawn with this pen.

Returns

DashStyle


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


lineCap

Get Signature

get lineCap(): PenLineCap

Gets the line cap style that specifies the shape used at the ends of open subpaths (and dashes, if any) when they are stroked.

Returns

PenLineCap


lineJoin

Get Signature

get lineJoin(): PenLineJoin

Gets the line join style that specifies the shape used at the corners of paths that are stroked.

Returns

PenLineJoin


miterLimit

Get Signature

get miterLimit(): number

Gets a maximum on the ratio of the miter length to the pen width. When the limit is exceeded, the join is converted from a miter to a bevel.

Returns

number


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om


width

Get Signature

get width(): number

Gets the pen width, in units used for drawing.

Returns

number

Methods

free()

free(): void

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


rebind()

rebind(omTo): void

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind