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
| Name | Type | Access | Description |
|---|---|---|---|
ctm | : Matrix | Read | Gets the ctm. |
liveMask | : PaintChannel | Read | Gets the live mask. |
ref | : unknown | Read | Gets the ref. |
Methods
| Signature | Description |
|---|---|
setLineWidth(w: number) → this | Sets the line width value. |
setStrokeColor(rgb: [number, number, number]) → this | Sets the stroke color value. |
setFillColor(rgb: [number, number, number]) → this | Sets the fill color value. |
setFillGradient(g: Gradient) → this | Fill subsequent paths with an axial or radial gradient. |
setStrokeGradient(g: Gradient) → this | Stroke subsequent paths with an axial or radial gradient. |
setFillPattern(pattern: ColoredTilingPattern) → this | Fill subsequent paths with pattern, a tiling pattern from {@link Document.NewTilingPattern}. |
setFillPattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → this | Sets the fill pattern value. |
setFillPattern(pattern: TilingPattern, color: [number, number, number]) → this | Sets the fill pattern value. |
setStrokePattern(pattern: ColoredTilingPattern) → this | Stroke subsequent paths with pattern. |
setStrokePattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → this | Sets the stroke pattern value. |
setStrokePattern(pattern: TilingPattern, color: [number, number, number]) → this | Sets the stroke pattern value. |
setLineCap(cap: 0 | 1 | 2) → this | Sets the line cap value. |
setLineJoin(join: 0 | 1 | 2) → this | Sets the line join value. |
setMiterLimit(limit: number) → this | Miter limit: the ratio at which a miter join (setLineJoin(0)) is cut off into a bevel. |
setDash(pattern: number[], phase) → this | Sets the dash value. |
setOpacity(alpha: number) → this | Sets the opacity value. |
save() → this | Calls save on this VectorGraphics instance. |
restore() → this | Calls restore on this VectorGraphics instance. |
transform(a: number, b: number, c: number, d: number, e: number, f: number) → this | Calls transform(a, b, c, d, e, f) on this VectorGraphics instance. |
BeginMarkedContent(tag: string, mcid: number) → this | Begin a marked-content sequence carrying an /MCID. |
BeginArtifact() → this | Begin an artifact sequence: /Artifact BMC, marking the following ops as content that belongs to no structure element. |
EndMarkedContent() → this | End the most recent marked-content sequence. |
BeginLayer(layer: Layer) → this | Begin an optional-content sequence: /OC /<key> BDC, tagging following ops into layer. |
EndLayer() → this | End the most recent {@link BeginLayer} sequence. |
moveTo(x: number, y: number) → this | Calls moveTo(x, y) on this VectorGraphics instance. |
lineTo(x: number, y: number) → this | Calls lineTo(x, y) on this VectorGraphics instance. |
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) → this | Calls curveTo(x1, y1, x2, y2, x3, y3) on this VectorGraphics instance. |
rect(x: number, y: number, w: number, h: number) → this | Calls rect(x, y, w, h) on this VectorGraphics instance. |
close() → this | Calls close on this VectorGraphics instance. |
drawLine(x1: number, y1: number, x2: number, y2: number) → this | Calls drawLine(x1, y1, x2, y2) on this VectorGraphics instance. |
drawRect(x: number, y: number, w: number, h: number) → this | Calls drawRect(x, y, w, h) on this VectorGraphics instance. |
circle(cx: number, cy: number, r: number) → this | Calls circle(cx, cy, r) on this VectorGraphics instance. |
polyline(points: [number, number][]) → this | An open polyline through points (at least two [x, y] pairs): a moveTo followed by a lineTo each. |
polygon(points: [number, number][]) → this | A 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) → this | A 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) → this | A 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) → this | Calls ellipse(cx, cy, rx, ry) on this VectorGraphics instance. |
stroke() → this | Calls stroke on this VectorGraphics instance. |
fill() → this | Calls fill on this VectorGraphics instance. |
fillEvenOdd() → this | Calls fillEvenOdd on this VectorGraphics instance. |
fillStroke() → this | Calls fillStroke on this VectorGraphics instance. |