## InsertDocument(int, bool) {#insertdocument}

Inserts an empty document with default page size at *index* position.

```csharp
public void InsertDocument(int index, bool activate = true)
```

| Parameter | Type | Description |
| --- | --- | --- |
| index | Int32 | Position at which a document should be inserted. |
| activate | Boolean | Flag indicating whether to select inserted document as active. |

### See Also

* class [XpsDocument](../)
* namespace [Aspose.Page.XPS](../../xpsdocument/)
* assembly [Aspose.Page](../../../)

---

## InsertDocument(int, float, float, bool) {#insertdocument_1}

Inserts an empty document with the first page dimensions *width* and *height* at *index* position.

```csharp
public void InsertDocument(int index, float width, float height, bool activate = true)
```

| Parameter | Type | Description |
| --- | --- | --- |
| index | Int32 | Position at which a document should be inserted. |
| width | Single | Width of the first page. |
| height | Single | Height of the first page. |
| activate | Boolean | Flag indicating whether to select inserted document as active. |

### See Also

* class [XpsDocument](../)
* namespace [Aspose.Page.XPS](../../xpsdocument/)
* assembly [Aspose.Page](../../../)


