Class

CGPDFDocument

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

Topics

Creating PDF Documents

init?(CGDataProvider)

Creates a Core Graphics PDF document using a data provider.

init?(CFURL)

Creates a Core Graphics PDF document using data specified by a URL.

Examining a PDF Document

var catalog: CGPDFDictionaryRef?

Returns the document catalog of a Core Graphics PDF document.

var fileIdentifier: CGPDFArrayRef?

Gets the file identifier for a PDF document.

var info: CGPDFDictionaryRef?

Gets the information dictionary for a PDF document.

var numberOfPages: Int

Returns the number of pages in a PDF document.

func getVersion(majorVersion: UnsafeMutablePointer<Int32>, minorVersion: UnsafeMutablePointer<Int32>)

Returns the major and minor version numbers of a Core Graphics PDF document.

func page(at: Int)

Returns a page from a Core Graphics PDF document.

Working with an Encrypted PDF Document

var isEncrypted: Bool

Returns whether the specified PDF file is encrypted.

var allowsCopying: Bool

Returns whether the specified PDF document allows copying.

var allowsPrinting: Bool

Returns whether a PDF document allows printing.

var isUnlocked: Bool

Returns whether the specified PDF document is currently unlocked.

func unlockWithPassword(UnsafePointer<Int8>)

Unlocks an encrypted PDF document when a valid password is supplied.

Working with Core Foundation Types

class var typeID: CFTypeID

Returns the type identifier for Core Graphics PDF documents.

Abstract Types for PDF Document Content

Use these abstract types and related functions to work with the content of a CGPDFDocument object.

CGPDFPage

A page in a PDF document.

CGPDFArray

An array structure within a PDF document.

CGPDFObject

An object representing content within a PDF document.

CGPDFStream

A stream or sequence of data bytes in a PDF document.

CGPDFString

A text string in a PDF document.

CGPDFScanner

A parser object for handling content and operators in a PDF content stream.

CGPDFDictionary

A dictionary structure within a PDF document.

CGPDFContentStream

A representation of one or more content data streams in a PDF page.

CGPDFOperatorTable

A set of callback functions for operators used when scanning content in a PDF document.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software