Skip to content

Svg ​

Defined in: components/svg.ts:641

Implements ​

Constructor components/svg.ts:652 ​

new Svg(source, options?): Svg

Parameters ​

ParameterType
sourcestring | Buffer<ArrayBufferLike>
options?SvgOptions

Returns ​

Svg

Properties ​

PropertyModifierType
align?
svg.ts:645
public"left" | "center" | "right"
height?
svg.ts:644
publicnumber
source
svg.ts:642
publicstring | Buffer<ArrayBufferLike>
width?
svg.ts:643
publicnumber

Methods ​

draw() components/svg.ts:764 ​

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/svg.ts:759 ​

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
svg.ts:759
number
width
svg.ts:759
number

Implementation of ​

Component.measure

Released under the MIT License.