---
title: "index(for:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfdocument/index(for:)"
---

# index(for:)

Gets the index number for the specified page.

## Declaration

```swift
func index(for page: PDFPage) -> Int
```

## Discussion

Discussion Indexes are zero-based. This method raises an exception and returns NSNotFound if page is not found.

## See Also

### Working with Pages

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