• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class PdfMatrix

A 2D affine transformation matrix in PDF convention. Transforms point (x,y) as: x' = Ax + Cy + E, y' = Bx + Dy + F.

Operations use post-multiplication (each operation is applied AFTER the current transform), which means: Identity.Translate(tx,ty).Rotate(θ) places the drawing origin at (tx,ty) then rotates the axes by θ around that origin.

Inheritance
object
PdfMatrix
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public sealed class PdfMatrix

Constructors

PdfMatrix()

Initializes a new identity PdfMatrix.

Declaration
public PdfMatrix()

PdfMatrix(double, double, double, double, double, double)

Initializes a new PdfMatrix with the specified components.

Declaration
public PdfMatrix(double a, double b, double c, double d, double e, double f)
Parameters
Type Name Description
double a
double b
double c
double d
double e
double f

Fields

A

Horizontal scaling component (a in matrix notation).

Declaration
public double A
Field Value
Type Description
double

B

Horizontal scaling component (a in matrix notation).

Declaration
public double B
Field Value
Type Description
double

C

Horizontal scaling component (a in matrix notation).

Declaration
public double C
Field Value
Type Description
double

D

Horizontal scaling component (a in matrix notation).

Declaration
public double D
Field Value
Type Description
double

E

Horizontal scaling component (a in matrix notation).

Declaration
public double E
Field Value
Type Description
double

F

Horizontal scaling component (a in matrix notation).

Declaration
public double F
Field Value
Type Description
double

Properties

Identity

Returns a new identity matrix.

Declaration
public static PdfMatrix Identity { get; }
Property Value
Type Description
PdfMatrix

Methods

Concat(PdfMatrix)

Return a new matrix that is this matrix post-multiplied by other. The result maps first by this, then by other.

Declaration
public PdfMatrix Concat(PdfMatrix other)
Parameters
Type Name Description
PdfMatrix other
Returns
Type Description
PdfMatrix

CreateTranslation(double, double)

Returns a new translation matrix.

Declaration
public static PdfMatrix CreateTranslation(double tx, double ty)
Parameters
Type Name Description
double tx
double ty
Returns
Type Description
PdfMatrix

Rotate(double)

Post-multiply by a rotation (counter-clockwise, degrees).

Declaration
public void Rotate(double degrees)
Parameters
Type Name Description
double degrees

Rotate(double, double, double)

Post-multiply by a rotation around a center point.

Declaration
public void Rotate(double degrees, double cx, double cy)
Parameters
Type Name Description
double degrees
double cx
double cy

Scale(double, double)

Post-multiply by a scale.

Declaration
public void Scale(double sx, double sy)
Parameters
Type Name Description
double sx
double sy

Scale(double, double, double, double)

Post-multiply by a scale around a center point.

Declaration
public void Scale(double sx, double sy, double cx, double cy)
Parameters
Type Name Description
double sx
double sy
double cx
double cy

Transform(ref PdfRect)

Transform a rectangle by applying this matrix to all four corners and returning the axis-aligned bounding box of the results.

Declaration
public void Transform(ref PdfRect bounds)
Parameters
Type Name Description
PdfRect bounds

Transform(double, double)

Transform a point using this matrix.

Declaration
public (double x, double y) Transform(double lx, double ly)
Parameters
Type Name Description
double lx
double ly
Returns
Type Description
(double X, double Y)

Translate(double, double)

Post-multiply by a translation.

Declaration
public void Translate(double tx, double ty)
Parameters
Type Name Description
double tx
double ty
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX