<!--
{
  "documentType" : "article",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/search-operations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Search Operations"
}
-->

# Search Operations

Find and search in PDFs.

## Topics

### Searching Documents

[`func findString(String, withOptions: NSString.CompareOptions) -> [PDFSelection]`](/documentation/PDFKit/PDFDocument/findString(_:withOptions:))

Synchronously finds all instances of the specified string in the document.

[`func beginFindString(String, withOptions: NSString.CompareOptions)`](/documentation/PDFKit/PDFDocument/beginFindString(_:withOptions:))

Asynchronously finds all instances of the specified string in the document.

[`func beginFindStrings([String], withOptions: NSString.CompareOptions)`](/documentation/PDFKit/PDFDocument/beginFindStrings(_:withOptions:))

Asynchronously finds all instances of the specified array of strings in the document.

[`func findString(String, fromSelection: PDFSelection?, withOptions: NSString.CompareOptions) -> PDFSelection?`](/documentation/PDFKit/PDFDocument/findString(_:fromSelection:withOptions:))

Synchronously finds the next occurance of a string after the specified selection (or before the selection if you specified `NSBackwardsSearch` as a search option.

[`var isFinding: Bool`](/documentation/PDFKit/PDFDocument/isFinding)

Returns a Boolean value indicating whether an asynchronous find operation is in progress.

[`func cancelFindString()`](/documentation/PDFKit/PDFDocument/cancelFindString())

Cancels a search initiated with [`beginFindString(_:withOptions:)`](/documentation/PDFKit/PDFDocument/beginFindString(_:withOptions:)).



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)