Skip to content

PDFMatrix

Namespace: O2S.Components.PDF4NET.Graphics

Defines a PDF transformation matrix.

public class PDFMatrix

Inheritance ObjectPDFMatrix

Constructors

PDFMatrix()

Initializes a new PDFMatrix object.

public PDFMatrix()

PDFMatrix(Double, Double, Double, Double, Double, Double)

Initializes a new PDFMatrix object.

public PDFMatrix(double m11, double m12, double m21, double m22, double tx, double ty)

Parameters

m11 Double
The element located at row 1, column 1.

m12 Double
The element located at row 1, column 2.

m21 Double
The element located at row 2, column 1.

m22 Double
The element located at row 2, column 2.

tx Double
The X translation offset.

ty Double
The Y translation offset.


PDFMatrix(PDFMatrix)

Initializes a new PDFMatrix object with an existing matrix.

public PDFMatrix(PDFMatrix matrix)

Parameters

matrix PDFMatrix
Source matrix.


Properties

M11

Gets or sets the m11 element.

public double M11 { get; set; }

Property Value

Double
The m11 element


M12

Gets or sets the m12 element.

public double M12 { get; set; }

Property Value

Double
The m12 element


M21

Gets or sets the m21 element.

public double M21 { get; set; }

Property Value

Double
The m21 element


M22

Gets or sets the m22 element.

public double M22 { get; set; }

Property Value

Double
The m22 element


TX

Gets or sets the tx element.

public double TX { get; set; }

Property Value

Double
The x translation element


TY

Gets or sets the ty element.

public double TY { get; set; }

Property Value

Double
The y translation element


Methods

InverseTransformPoint(PDFPoint)

Applies the geometric transform represented by the inverse of this matrix to a specified point.

public PDFPoint InverseTransformPoint(PDFPoint point)

Parameters

point PDFPoint
Point to transform.

Returns

PDFPoint
Transformed point.


InverseTransformPoint(Double, Double)

Applies the geometric transform represented by the inverse of this matrix to a specified point.

public PDFPoint InverseTransformPoint(double x, double y)

Parameters

x Double
X coordinate of the point.

y Double
Y coordinate of the point.

Returns

PDFPoint
Transformed point.


InverseTransformPoints(PDFPoint[])

Applies the geometric transform represented by the inverse of this matrix to the specified array of points.

public void InverseTransformPoints(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of PDFPoint objects that represents the points to transform.


Invert()

Inverts this matrix object.

public void Invert()

Multiply(PDFMatrix)

Multiplies this matrix by the matrix specified in the matrix parameter.

public void Multiply(PDFMatrix matrix)

Parameters

matrix PDFMatrix
The matrix by which this matrix is to be multiplied.


Multiply(PDFMatrix, Boolean)

Multiplies this matrix by the matrix specified in the matrix parameter.

public void Multiply(PDFMatrix matrix, bool append)

Parameters

matrix PDFMatrix
The matrix by which this matrix is to be multiplied.

append Boolean
True if the new operation is appended, otherwise it is prepended.


Rotate(Double)

Prepend to this matrix a clockwise rotation, around the origin and by the specified angle.

public void Rotate(double angle)

Parameters

angle Double
The angle of the rotation, in degrees.


RotatedMatrix(Double)

Creates a matrix with a rotation as the initial value.

public static PDFMatrix RotatedMatrix(double angle)

Parameters

angle Double
Rotation angle in degrees.

Returns

PDFMatrix
The matrix.


Scale(Double, Double)

Applies the specified scale vector to this Matrix by prepending the scale vector.

public void Scale(double sx, double sy)

Parameters

sx Double
The value by which to scale this matrix in the x-axis direction.

sy Double
The value by which to scale this matrix in the y-axis direction.


ScaledMatrix(Double, Double)

Creates a matrix with a scaling as the initial value.

public static PDFMatrix ScaledMatrix(double sx, double sy)

Parameters

sx Double
Scaling on X axis.

sy Double
Scaling on Y axis.

Returns

PDFMatrix
The matrix.


TransformPoint(Double, Double)

Applies the geometric transform represented by this matrix to a specified point.

public PDFPoint TransformPoint(double x, double y)

Parameters

x Double
X coordinate of the point.

y Double
Y coordinate of the point.

Returns

PDFPoint
Transformed point.


TransformPoint(PDFPoint)

Applies the geometric transform represented by this matrix to a specified point.

public PDFPoint TransformPoint(PDFPoint point)

Parameters

point PDFPoint
Point to transform.

Returns

PDFPoint
Transformed point.


TransformPoints(PDFPoint[])

Applies the geometric transform represented by this matrix to a specified array of points.

public void TransformPoints(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of PDFPoint objects that represents the points to transform.


TransformPoints(Double[])

Applies the geometric transform represented by this matrix to a specified array of points.

public void TransformPoints(Double[] points)

Parameters

points Double[]
An array of double pairs (x, y) that represents the points to transform.


TransformPoints(Double[], Int32, Int32)

Applies the geometric transform represented by this matrix to a specified array of points.

public void TransformPoints(Double[] points, int offset, int count)

Parameters

points Double[]
An array of double pairs (x, y) that represents the points to transform.

offset Int32
Offset in points array where the data starts

count Int32
Number of points


TransformVector(Double, Double)

Applies only the scale and rotate components of this matrix to the specified point.

public PDFPoint TransformVector(double x, double y)

Parameters

x Double
X coordinate of the point.

y Double
Y coordinate of the point.

Returns

PDFPoint
Transformed point.


TransformVector(PDFPoint)

Applies only the scale and rotate components of this matrix to the specified point.

public PDFPoint TransformVector(PDFPoint point)

Parameters

point PDFPoint
Point to transform.

Returns

PDFPoint
Transformed point.


TransformVectors(PDFPoint[])

Applies only the scale and rotate components of this matrix to the specified array of points.

public void TransformVectors(PDFPoint[] points)

Parameters

points PDFPoint[]
An array of PDFPoint objects that represents the points to transform.


Translate(Double, Double)

Applies the specified translation vector (tx and ty) to this matrix by prepending the translation vector.

public void Translate(double tx, double ty)

Parameters

tx Double
The x value by which to translate this matrix.

ty Double
The y value by which to translate this matrix.


TranslatedMatrix(Double, Double)

Creates a matrix with a translation as the initial value.

public static PDFMatrix TranslatedMatrix(double tx, double ty)

Parameters

tx Double
Translation on X axis.

ty Double
Translation on Y axis.

Returns

PDFMatrix
The matrix.