# PdfMatrix struct

> A 2D affine transform in PDF order [a b c d e f]: x' = a x + c y + e, y' = b x + d y + f.

Namespace: [PdfNetStack.Drawing](https://www.jadev-corp.com/api/pdfnetstack-drawing/)  
Assembly: PdfNetStack.dll  
Package: `PdfNetStack`

A 2D affine transform in PDF order [a b c d e f]: x' = a x + c y + e, y' = b x + d y + f.

```csharp
public readonly record struct PdfMatrix : IEquatable<PdfMatrix>
```

**Implements**

[IEquatable&lt;PdfMatrix\>](https://learn.microsoft.com/dotnet/api/system.iequatable\-1)

## Constructors

### <a id="PdfNetStack_Drawing_PdfMatrix__ctor_System_Double_System_Double_System_Double_System_Double_System_Double_System_Double_"></a> PdfMatrix\(double, double, double, double, double, double\)

A 2D affine transform in PDF order [a b c d e f]: x' = a x + c y + e, y' = b x + d y + f.

```csharp
public PdfMatrix(double A, double B, double C, double D, double E, double F)
```

#### Parameters

`A` [double](https://learn.microsoft.com/dotnet/api/system.double)

Horizontal scale component.

`B` [double](https://learn.microsoft.com/dotnet/api/system.double)

Vertical shear component.

`C` [double](https://learn.microsoft.com/dotnet/api/system.double)

Horizontal shear component.

`D` [double](https://learn.microsoft.com/dotnet/api/system.double)

Vertical scale component.

`E` [double](https://learn.microsoft.com/dotnet/api/system.double)

Horizontal translation.

`F` [double](https://learn.microsoft.com/dotnet/api/system.double)

Vertical translation.

## Properties

### <a id="PdfNetStack_Drawing_PdfMatrix_A"></a> A

Horizontal scale component.

```csharp
public double A { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_B"></a> B

Vertical shear component.

```csharp
public double B { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_C"></a> C

Horizontal shear component.

```csharp
public double C { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_D"></a> D

Vertical scale component.

```csharp
public double D { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_E"></a> E

Horizontal translation.

```csharp
public double E { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_F"></a> F

Vertical translation.

```csharp
public double F { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfMatrix_Identity"></a> Identity

The identity transform.

```csharp
public static PdfMatrix Identity { get; }
```

#### Property Value

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_IsInvertible"></a> IsInvertible

True when the transform can be inverted.

```csharp
public bool IsInvertible { get; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### <a id="PdfNetStack_Drawing_PdfMatrix_CreateRotation_System_Double_"></a> CreateRotation\(double\)

A rotation about the origin. On the canvas, whose y axis points down, positive angles turn
clockwise, as in CSS.

```csharp
public static PdfMatrix CreateRotation(double degrees)
```

#### Parameters

`degrees` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_CreateScale_System_Double_System_Double_"></a> CreateScale\(double, double\)

A scale about the origin.

```csharp
public static PdfMatrix CreateScale(double sx, double sy)
```

#### Parameters

`sx` [double](https://learn.microsoft.com/dotnet/api/system.double)

`sy` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_CreateSkew_System_Double_System_Double_"></a> CreateSkew\(double, double\)

A skew by the given angles, in degrees.

```csharp
public static PdfMatrix CreateSkew(double degreesX, double degreesY)
```

#### Parameters

`degreesX` [double](https://learn.microsoft.com/dotnet/api/system.double)

`degreesY` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_CreateTranslation_System_Double_System_Double_"></a> CreateTranslation\(double, double\)

A translation.

```csharp
public static PdfMatrix CreateTranslation(double dx, double dy)
```

#### Parameters

`dx` [double](https://learn.microsoft.com/dotnet/api/system.double)

`dy` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_Invert"></a> Invert\(\)

The inverse transform.

```csharp
public PdfMatrix Invert()
```

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

#### Exceptions

 [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)

The transform is singular.

### <a id="PdfNetStack_Drawing_PdfMatrix_Multiply_PdfNetStack_Drawing_PdfMatrix_PdfNetStack_Drawing_PdfMatrix_"></a> Multiply\(PdfMatrix, PdfMatrix\)

The transform that applies <code class="paramref">first</code>, then <code class="paramref">second</code>.

```csharp
public static PdfMatrix Multiply(PdfMatrix first, PdfMatrix second)
```

#### Parameters

`first` [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

`second` [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

#### Returns

 [PdfMatrix](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfmatrix/)

### <a id="PdfNetStack_Drawing_PdfMatrix_Transform_PdfNetStack_Drawing_PdfPoint_"></a> Transform\(PdfPoint\)

Applies the transform to a point.

```csharp
public PdfPoint Transform(PdfPoint point)
```

#### Parameters

`point` [PdfPoint](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpoint/)

#### Returns

 [PdfPoint](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpoint/)

## Used in

- [Draw on PDF pages in C# and .NET](https://www.jadev-corp.com/guides/drawing/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-drawing/pdfmatrix/
