---
title: "insert(_:at:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfdocument/insert(_:at:)"
---

# insert(_:at:)

Inserts a page at the specified index point.

## Declaration

```swift
func insert(_ page: PDFPage, at index: Int)
```

## Discussion

Discussion This method raises an exception if index is out of bounds. Be aware that a PDF viewing application might use the size of the first page in the document as representative of all page sizes when reporting the size of a document. If you need to get the actual size of an individual page, you can use bounds(for:) (note that the size is returned in points, which are typically converted to inches or centimeters by PDF viewing applications).

## See Also

### Working with Pages

- [pageCount](pdfkit/pdfdocument/pagecount.md)
- [page(at:)](pdfkit/pdfdocument/page(at:).md)
- [index(for:)](pdfkit/pdfdocument/index(for:).md)
- [removePage(at:)](pdfkit/pdfdocument/removepage(at:).md)
- [exchangePage(at:withPageAt:)](pdfkit/pdfdocument/exchangepage(at:withpageat:).md)
- [pageClass](pdfkit/pdfdocument/pageclass.md)
