# PdfForm class

> A reusable drawing (a form XObject, ISO 32000-1, 8.10): drawn once, placed any number of times with DrawForm. Use it for stamps, letterheads and...

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

A reusable drawing (a form XObject, ISO 32000-1, 8.10): drawn once, placed any number of times
with [DrawForm](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfgraphics/#PdfNetStack_Drawing_PdfGraphics_DrawForm_PdfNetStack_Drawing_PdfForm_System_Double_System_Double_System_Double_System_Double_). Use it for
stamps, letterheads and repeated logos, or with [FromPage](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfform/#PdfNetStack_Drawing_PdfForm_FromPage_PdfNetStack_PdfDocument_PdfNetStack_PdfPage_) to place a page of any
document, scaled and positioned, on another page.

```csharp
public sealed class PdfForm
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfForm](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfform/)

## Properties

### <a id="PdfNetStack_Drawing_PdfForm_Document"></a> Document

The document the form belongs to.

```csharp
public PdfDocument Document { get; }
```

#### Property Value

 [PdfDocument](https://www.jadev-corp.com/api/pdfnetstack/pdfdocument/)

### <a id="PdfNetStack_Drawing_PdfForm_Height"></a> Height

Height in points.

```csharp
public double Height { get; }
```

#### Property Value

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

### <a id="PdfNetStack_Drawing_PdfForm_Width"></a> Width

Width in points.

```csharp
public double Width { get; }
```

#### Property Value

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

## Methods

### <a id="PdfNetStack_Drawing_PdfForm_Create_PdfNetStack_PdfDocument_System_Double_System_Double_"></a> Create\(PdfDocument, double, double\)

An empty form to draw into with [CreateGraphics](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfform/#PdfNetStack_Drawing_PdfForm_CreateGraphics).

```csharp
public static PdfForm Create(PdfDocument document, double width, double height)
```

#### Parameters

`document` [PdfDocument](https://www.jadev-corp.com/api/pdfnetstack/pdfdocument/)

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

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

#### Returns

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

### <a id="PdfNetStack_Drawing_PdfForm_CreateGraphics"></a> CreateGraphics\(\)

A canvas on the form, top left origin, in points. Dispose it to write the drawing.

```csharp
public PdfGraphics CreateGraphics()
```

#### Returns

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

### <a id="PdfNetStack_Drawing_PdfForm_FromPage_PdfNetStack_PdfDocument_PdfNetStack_PdfPage_"></a> FromPage\(PdfDocument, PdfPage\)

A form showing a page's visible area (its crop box), upright as the page's rotation
shows it. The page may belong to another document; its fonts and images are copied over.
Annotations are not part of the page's content and are not included.

```csharp
public static PdfForm FromPage(PdfDocument document, PdfPage page)
```

#### Parameters

`document` [PdfDocument](https://www.jadev-corp.com/api/pdfnetstack/pdfdocument/)

`page` [PdfPage](https://www.jadev-corp.com/api/pdfnetstack/pdfpage/)

#### Returns

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

#### Exceptions

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

The page's document does not permit copying its content.

## Used in

- [PDF coordinates and units in PdfNetStack](https://www.jadev-corp.com/concepts/coordinates-and-units/)
- [PDF links and annotations in C# and .NET](https://www.jadev-corp.com/guides/annotations/)
- [Add images to PDF in C# and .NET](https://www.jadev-corp.com/guides/images/)
- [Add a watermark to a PDF in C#](https://www.jadev-corp.com/recipes/add-watermark/)

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