StrokeState#

A StrokeState object is used to define stroke styles.

CONSTRUCTOR METHODS

StrokeState()#

Create a new empty stroke state object.

Returns:

StrokeState.

EXAMPLE

var strokeState = new mupdfjs.StrokeState();

INSTANCE METHODS

setLineCap(style: number | string)#

Sets a line cap from an enumeration.

Parameters:

stylestring | number. See LINE_CAP.

EXAMPLE

strokeState.setLineCap("Butt");
getLineCap()#

Gets a line cap from an enumeration.

Returns:

number. See LINE_CAP.

EXAMPLE

var lineCap = strokeState.getLineCap();
setLineJoin(style: number | string)#

Sets a line join from an enumeration.

Parameters:

stylestring | number. See LINE_JOIN.

EXAMPLE

strokeState.setLineJoin("Round");
getLineJoin()#

Gets a line join from an enumeration.

Returns:

number. See LINE_JOIN.

EXAMPLE

var lineJoin = strokeState.getLineJoin();
setLineWidth(width: number)#
Parameters:

widthnumber.

EXAMPLE

strokeState.setLineWidth(2);
getLineWidth()#
Returns:

number.

EXAMPLE

var width = strokeState.getLineWidth();
setMiterLimit(width: number)#
Parameters:

widthnumber.

EXAMPLE

strokeState.setMiterLimit(2);
getMiterLimit()#
Returns:

number.

EXAMPLE

var limit = strokeState.getMiterLimit();

Class enumerations#

The following enumerations are available for line caps and joins.

static readonly LINE_CAP: LineCap[] = [
    "Butt",
    "Round",
    "Square",
    "Triangle"
]

static readonly LINE_JOIN: LineJoin[] = [
    "Miter",
    "Round",
    "Bevel",
    "MiterXPS"
]

Code samples

Code samples are in TypeScript and assume that the following requirements are defined in your TypeScript file header as follows:

import * as fs from "fs"
import * as mupdfjs from "mupdf/mupdfjs"