PageGraphics

Overview

PageGraphics is a class in Aspose.PDF FOSS for TypeScript. Inherits from: VectorGraphics.

A buffered builder for drawing vector content onto a page.

This class declares 43 methods for PageGraphics objects in TypeScript programs. Available methods include: BeginArtifact, BeginLayer, BeginMarkedContent, EndLayer, EndMarkedContent, apply, arc, circle, close, constructor, curveTo, drawLine, and 27 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
constructor(doc: Document, page: Page)Calls constructor(doc, page) on this PageGraphics instance.
apply()Calls apply on this PageGraphics instance.
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 PageGraphics instance.
restore()thisCalls restore on this PageGraphics instance.
transform(a: number, b: number, c: number, d: number, e: number, f: number)thisCalls transform(a, b, c, d, e, f) on this PageGraphics 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 PageGraphics instance.
lineTo(x: number, y: number)thisCalls lineTo(x, y) on this PageGraphics instance.
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number)thisCalls curveTo(x1, y1, x2, y2, x3, y3) on this PageGraphics instance.
rect(x: number, y: number, w: number, h: number)thisCalls rect(x, y, w, h) on this PageGraphics instance.
close()thisCalls close on this PageGraphics instance.
drawLine(x1: number, y1: number, x2: number, y2: number)thisCalls drawLine(x1, y1, x2, y2) on this PageGraphics instance.
drawRect(x: number, y: number, w: number, h: number)thisCalls drawRect(x, y, w, h) on this PageGraphics instance.
circle(cx: number, cy: number, r: number)thisCalls circle(cx, cy, r) on this PageGraphics 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 PageGraphics instance.
stroke()thisCalls stroke on this PageGraphics instance.
fill()thisCalls fill on this PageGraphics instance.
fillEvenOdd()thisCalls fillEvenOdd on this PageGraphics instance.
fillStroke()thisCalls fillStroke on this PageGraphics instance.