VectorGraphics

Overview

VectorGraphics is a class in Aspose.PDF FOSS for TypeScript.

A buffered builder for vector content: every path constructor, paint operator, graphics-state setting and marked-content bracket, accumulated in memory as operator text.

This class declares 41 methods for VectorGraphics objects in TypeScript programs. Available methods include: BeginArtifact, BeginLayer, BeginMarkedContent, EndLayer, EndMarkedContent, arc, circle, close, curveTo, drawLine, drawRect, ellipse, and 25 additional methods. All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package. Properties: ctm, liveMask, ref.

Properties

NameTypeAccessDescription
ctm: MatrixReadGets the ctm.
liveMask: PaintChannelReadGets the live mask.
ref: unknownReadGets the ref.

Methods

SignatureDescription
setLineWidth(w: number) → thisSets the line width value.
setStrokeColor(rgb: [number, number, number]) → thisSets the stroke color value.
setFillColor(rgb: [number, number, number]) → thisSets the fill color value.
setFillGradient(g: Gradient) → thisFill subsequent paths with an axial or radial gradient.
setStrokeGradient(g: Gradient) → thisStroke subsequent paths with an axial or radial gradient.
setFillPattern(pattern: ColoredTilingPattern) → thisFill subsequent paths with pattern, a tiling pattern from {@link Document.NewTilingPattern}.
setFillPattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → thisSets the fill pattern value.
setFillPattern(pattern: TilingPattern, color: [number, number, number]) → thisSets the fill pattern value.
setStrokePattern(pattern: ColoredTilingPattern) → thisStroke subsequent paths with pattern.
setStrokePattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → thisSets the stroke pattern value.
setStrokePattern(pattern: TilingPattern, color: [number, number, number]) → thisSets the stroke pattern value.
setLineCap(cap: 0 | 1 | 2) → thisSets the line cap value.
setLineJoin(join: 0 | 1 | 2) → thisSets the line join value.
setMiterLimit(limit: number) → thisMiter limit: the ratio at which a miter join (setLineJoin(0)) is cut off into a bevel.
setDash(pattern: number[], phase) → thisSets the dash value.
setOpacity(alpha: number) → thisSets the opacity value.
save() → thisCalls save on this VectorGraphics instance.
restore() → thisCalls restore on this VectorGraphics instance.
transform(a: number, b: number, c: number, d: number, e: number, f: number) → thisCalls transform(a, b, c, d, e, f) on this VectorGraphics instance.
BeginMarkedContent(tag: string, mcid: number) → thisBegin a marked-content sequence carrying an /MCID.
BeginArtifact() → thisBegin an artifact sequence: /Artifact BMC, marking the following ops as content that belongs to no structure element.
EndMarkedContent() → thisEnd the most recent marked-content sequence.
BeginLayer(layer: Layer) → thisBegin an optional-content sequence: /OC /<key> BDC, tagging following ops into layer.
EndLayer() → thisEnd the most recent {@link BeginLayer} sequence.
moveTo(x: number, y: number) → thisCalls moveTo(x, y) on this VectorGraphics instance.
lineTo(x: number, y: number) → thisCalls lineTo(x, y) on this VectorGraphics instance.
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) → thisCalls curveTo(x1, y1, x2, y2, x3, y3) on this VectorGraphics instance.
rect(x: number, y: number, w: number, h: number) → thisCalls rect(x, y, w, h) on this VectorGraphics instance.
close() → thisCalls close on this VectorGraphics instance.
drawLine(x1: number, y1: number, x2: number, y2: number) → thisCalls drawLine(x1, y1, x2, y2) on this VectorGraphics instance.
drawRect(x: number, y: number, w: number, h: number) → thisCalls drawRect(x, y, w, h) on this VectorGraphics instance.
circle(cx: number, cy: number, r: number) → thisCalls circle(cx, cy, r) on this VectorGraphics instance.
polyline(points: [number, number][]) → thisAn open polyline through points (at least two [x, y] pairs): a moveTo followed by a lineTo each.
polygon(points: [number, number][]) → thisA closed polygon through points: {@link polyline} plus a closing h, so a fill has a well-defined boundary and a stroke joins the last edge to the first rather than capping it.
roundedRect(x: number, y: number, w: number, h: number, r: number) → thisA rectangle with quarter-circle corners of radius r, clamped to half the shorter side (so an over-large radius gives a stadium, never a self-crossing path).
arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number) → thisA circular arc of radius r about (cx, cy), from startAngle to endAngle in radians (0 = +x axis, increasing counter-clockwise, as in Canvas 2D).
ellipse(cx: number, cy: number, rx: number, ry: number) → thisCalls ellipse(cx, cy, rx, ry) on this VectorGraphics instance.
stroke() → thisCalls stroke on this VectorGraphics instance.
fill() → thisCalls fill on this VectorGraphics instance.
fillEvenOdd() → thisCalls fillEvenOdd on this VectorGraphics instance.
fillStroke() → thisCalls fillStroke on this VectorGraphics instance.
 English