# PdfArray class

> A PDF array. PdfArray class, PdfNetStack.Objects namespace.

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

A PDF array.

```csharp
public sealed class PdfArray : PdfObject, IReadOnlyList<PdfObject>, IReadOnlyCollection<PdfObject>, IEnumerable<PdfObject>, IEnumerable
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/) ← 
[PdfArray](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfarray/)

**Implements**

[IReadOnlyList&lt;PdfObject\>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1), 
[IReadOnlyCollection&lt;PdfObject\>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection\-1), 
[IEnumerable&lt;PdfObject\>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable\-1), 
[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

## Constructors

### <a id="PdfNetStack_Objects_PdfArray__ctor"></a> PdfArray\(\)

Creates an empty array.

```csharp
public PdfArray()
```

## Properties

### <a id="PdfNetStack_Objects_PdfArray_Count"></a> Count

Number of items.

```csharp
public int Count { get; }
```

#### Property Value

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

### <a id="PdfNetStack_Objects_PdfArray_Item_System_Int32_"></a> this\[int\]

The item at <code class="paramref">index</code>. Items may be references; resolve them through the document.

```csharp
public PdfObject this[int index] { get; set; }
```

#### Property Value

 [PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/)

## Methods

### <a id="PdfNetStack_Objects_PdfArray_Add_PdfNetStack_Objects_PdfObject_"></a> Add\(PdfObject\)

Appends an item.

```csharp
public void Add(PdfObject item)
```

#### Parameters

`item` [PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/)

### <a id="PdfNetStack_Objects_PdfArray_Clear"></a> Clear\(\)

Removes every item.

```csharp
public void Clear()
```

### <a id="PdfNetStack_Objects_PdfArray_GetEnumerator"></a> GetEnumerator\(\)

Returns an enumerator that iterates through the collection.

```csharp
public IEnumerator<PdfObject> GetEnumerator()
```

#### Returns

 [IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator\-1)<[PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/)\>

An enumerator that can be used to iterate through the collection.

### <a id="PdfNetStack_Objects_PdfArray_Insert_System_Int32_PdfNetStack_Objects_PdfObject_"></a> Insert\(int, PdfObject\)

Inserts an item at <code class="paramref">index</code>.

```csharp
public void Insert(int index, PdfObject item)
```

#### Parameters

`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)

`item` [PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/)

### <a id="PdfNetStack_Objects_PdfArray_Of_PdfNetStack_Objects_PdfObject___"></a> Of\(params PdfObject\[\]\)

Creates an array of the given items.

```csharp
public static PdfArray Of(params PdfObject[] items)
```

#### Parameters

`items` [PdfObject](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfobject/)\[\]

#### Returns

 [PdfArray](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfarray/)

### <a id="PdfNetStack_Objects_PdfArray_Of_System_Double___"></a> Of\(params double\[\]\)

Creates an array of numbers.

```csharp
public static PdfArray Of(params double[] numbers)
```

#### Parameters

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

#### Returns

 [PdfArray](https://www.jadev-corp.com/api/pdfnetstack-objects/pdfarray/)

### <a id="PdfNetStack_Objects_PdfArray_RemoveAt_System_Int32_"></a> RemoveAt\(int\)

Removes the item at <code class="paramref">index</code>.

```csharp
public void RemoveAt(int index)
```

#### Parameters

`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)

## Used in

- [Edit PDF pages in C# and .NET](https://www.jadev-corp.com/guides/edit-pages/)
- [Low level PDF objects in C#](https://www.jadev-corp.com/guides/low-level-objects/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-objects/pdfarray/
