<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFDocument",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFDocument"
  },
  "title" : "PDFDocument"
}
-->

# PDFDocument

An object that represents PDF data or a PDF file and defines methods for writing, searching, and selecting PDF data.

```
class PDFDocument
```

## Overview

The other utility classes are either instantiated from methods in `PDFDocument`, as are `PDFPage` and `PDFOutline`; or support it, as do `PDFSelection` and `PDFDestination`.

You initialize a `PDFDocument` object with PDF data or with a URL to a PDF file. You can then ask for the page count, add or delete pages, perform a find, or parse selected content into an `NSString` object.

## Topics

### Initializing Documents

[`init(url:)`](/documentation/PDFKit/PDFDocument/init(url:)-98jte)

Initializes a `PDFDocument` object with the contents at the specified URL (if the URL is invalid, this method returns `NULL`).

[`init(data:)`](/documentation/PDFKit/PDFDocument/init(data:))

Initializes a `PDFDocument` object with the passed-in data.

[`init()`](/documentation/PDFKit/PDFDocument/init())

Initializes a `PDFDocument` object.

### Reading and Writing PDFs

[Read Operations](/documentation/PDFKit/read-operations)

Operations that let you access documents and pages, manage document security, and work with searching and selections.

[Write Operations](/documentation/PDFKit/write-operations)

Operations that let you write document data to different locations.

### Setting the Delegate

[`delegate`](/documentation/PDFKit/PDFDocument/delegate)

The object acting as the delegate for the `PDFDocument` object.

[`PDFDocumentDelegate`](/documentation/PDFKit/PDFDocumentDelegate)

The delegate for the `PDFDocument` object.

### Constants

[`PDFDocumentPermissions`](/documentation/PDFKit/PDFDocumentPermissions)

An enumeration that specifies document permissions status.

[`PDFDocumentAttribute`](/documentation/PDFKit/PDFDocumentAttribute)

A structure that specifies document attributes.

[`PDFDocumentWriteOption`](/documentation/PDFKit/PDFDocumentWriteOption)

A structure that specifies file writing options for a document.

### Notifications

[`PDFDocumentDidUnlockNotification`](/documentation/PDFKit/PDFDocumentDidUnlockNotification)

A notification that a document unlocks after a [`unlock(withPassword:)`](/documentation/PDFKit/PDFDocument/unlock(withPassword:)) message.

[`PDFDocumentDidBeginFindNotification`](/documentation/PDFKit/PDFDocumentDidBeginFindNotification)

A notification that the [`beginFindString(_:withOptions:)`](/documentation/PDFKit/PDFDocument/beginFindString(_:withOptions:)) or [`findString(_:withOptions:)`](/documentation/PDFKit/PDFDocument/findString(_:withOptions:)) method begins finding.

[`PDFDocumentDidEndFindNotification`](/documentation/PDFKit/PDFDocumentDidEndFindNotification)

A notification that the [`beginFindString(_:withOptions:)`](/documentation/PDFKit/PDFDocument/beginFindString(_:withOptions:)) or [`findString(_:withOptions:)`](/documentation/PDFKit/PDFDocument/findString(_:withOptions:)) method returns.

[`PDFDocumentDidBeginPageFindNotification`](/documentation/PDFKit/PDFDocumentDidBeginPageFindNotification)

A notification that a find operation begins working on a new page of a document.

[`PDFDocumentDidEndPageFindNotification`](/documentation/PDFKit/PDFDocumentDidEndPageFindNotification)

A notification that a find operation finishes working on a page in a document.

[`PDFDocumentDidFindMatchNotification`](/documentation/PDFKit/PDFDocumentDidFindMatchNotification)

A notification that a string match is found in a document.

[`PDFDocumentDidBeginWriteNotification`](/documentation/PDFKit/PDFDocumentDidBeginWriteNotification)

A notification that a write operation begins working on a document.

[`PDFDocumentDidEndWriteNotification`](/documentation/PDFKit/PDFDocumentDidEndWriteNotification)

A notification that a write operation finishes working on a document.

[`PDFDocumentDidBeginPageWriteNotification`](/documentation/PDFKit/PDFDocumentDidBeginPageWriteNotification)

A notification that a write operation begins working on a page in a document.

[`PDFDocumentDidEndPageWriteNotification`](/documentation/PDFKit/PDFDocumentDidEndPageWriteNotification)

A notification that a write operation finishes working on a page in a document.

### Instance Properties

[`accessPermissions`](/documentation/PDFKit/PDFDocument/accessPermissions)



---

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)