---
title: CGPDFDocument
framework: coregraphics
role: symbol
role_heading: Class
path: coregraphics/cgpdfdocument
---

# CGPDFDocument

A document that contains PDF (Portable Document Format) drawing information.

## Declaration

```swift
class CGPDFDocument
```

## Overview

Overview PDF provides an efficient format for cross-platform exchange of documents with rich content. PDF files can contain multiple pages of images and text. A PDF document object contains all the information relating to a PDF document, including its catalog and contents. Note that PDF documents may be encrypted, and that some operations may be restricted until a valid password is supplied—see the functions listed in Working with an Encrypted PDF Document.  Core Graphics also supports decrypting encrypted documents. Core Graphics can both display and generate files that are compliant with the PDF standard.

## Topics

### Creating PDF Documents

- [init(_:)](coregraphics/cgpdfdocument/init(_:)-gbq6.md)
- [init(_:)](coregraphics/cgpdfdocument/init(_:)-2gtsd.md)

### Examining a PDF Document

- [catalog](coregraphics/cgpdfdocument/catalog.md)
- [fileIdentifier](coregraphics/cgpdfdocument/fileidentifier.md)
- [info](coregraphics/cgpdfdocument/info.md)
- [numberOfPages](coregraphics/cgpdfdocument/numberofpages.md)
- [getVersion(majorVersion:minorVersion:)](coregraphics/cgpdfdocument/getversion(majorversion:minorversion:).md)
- [page(at:)](coregraphics/cgpdfdocument/page(at:).md)

### Working with an Encrypted PDF Document

- [isEncrypted](coregraphics/cgpdfdocument/isencrypted.md)
- [allowsCopying](coregraphics/cgpdfdocument/allowscopying.md)
- [allowsPrinting](coregraphics/cgpdfdocument/allowsprinting.md)
- [isUnlocked](coregraphics/cgpdfdocument/isunlocked.md)
- [unlockWithPassword(_:)](coregraphics/cgpdfdocument/unlockwithpassword(_:).md)

### Working with Core Foundation Types

- [typeID](coregraphics/cgpdfdocument/typeid.md)

### Abstract Types for PDF Document Content

- [CGPDFPage](coregraphics/cgpdfpage.md)
- [CGPDFArray](coregraphics/cgpdfarray.md)
- [CGPDFObject](coregraphics/cgpdfobject.md)
- [CGPDFStream](coregraphics/cgpdfstream.md)
- [CGPDFString](coregraphics/cgpdfstring.md)
- [CGPDFScanner](coregraphics/cgpdfscanner.md)
- [CGPDFDictionary](coregraphics/cgpdfdictionary.md)
- [CGPDFContentStream](coregraphics/cgpdfcontentstream.md)
- [CGPDFOperatorTable](coregraphics/cgpdfoperatortable.md)

### Instance Properties

- [accessPermissions](coregraphics/cgpdfdocument/accesspermissions.md)
- [outline](coregraphics/cgpdfdocument/outline.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
