CGPDFDocument

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

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 Managing Encryption. Core Graphics also supports decrypting encrypted documents.

Core Graphics can both display and generate files that are compliant with the PDF standard. When imaging PDF files, CGPDFDocumentRef is the basic type used to represent a PDF document.

Topics

Creating PDF Document Objects

CGPDFDocumentCreateWithProvider

Creates a Core Graphics PDF document using a data provider.

CGPDFDocumentCreateWithURL

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

Retaining and Releasing PDF Documents

CGPDFDocumentRelease

Decrements the retain count of a PDF document.

CGPDFDocumentRetain

Increments the retain count of a Core Graphics PDF document.

Getting the CFType ID for a PDF Document Object

CGPDFDocumentGetTypeID

Returns the type identifier for Core Graphics PDF documents.

Getting Information About Core Graphics PDF Documents

CGPDFDocumentGetCatalog

Returns the document catalog of a Core Graphics PDF document.

CGPDFDocumentGetNumberOfPages

Returns the number of pages in a PDF document.

CGPDFDocumentGetPage

Returns a page from a Core Graphics PDF document.

CGPDFDocumentGetVersion

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

CGPDFDocumentGetInfo

Gets the information dictionary for a PDF document.

CGPDFDocumentGetID

Gets the file identifier for a PDF document.

Managing Encryption

CGPDFDocumentAllowsCopying

Returns whether the specified PDF document allows copying.

CGPDFDocumentAllowsPrinting

Returns whether a PDF document allows printing.

CGPDFDocumentIsEncrypted

Returns whether the specified PDF file is encrypted.

CGPDFDocumentIsUnlocked

Returns whether the specified PDF document is currently unlocked.

CGPDFDocumentUnlockWithPassword

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

Getting Page Information

CGPDFDocumentGetArtBox

Returns the art box of a page in a PDF document.

Deprecated
CGPDFDocumentGetBleedBox

Returns the bleed box of a page in a PDF document.

Deprecated
CGPDFDocumentGetCropBox

Returns the crop box of a page in a PDF document.

Deprecated
CGPDFDocumentGetMediaBox

Returns the media box of a page in a PDF document.

Deprecated
CGPDFDocumentGetRotationAngle

Returns the rotation angle of a page in a PDF document.

Deprecated
CGPDFDocumentGetTrimBox

Returns the trim box of a page in a PDF document.

Deprecated

Data Types

CGPDFDocumentRef

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

See Also

Opaque Types

CGBitmapContext

A type of CGContextRef that you can use for drawing bits to memory.

CGColor

A set of components that define a color, with a color space specifying how to interpret them.

CGColorConversionInfo

An object that describes how to convert between color spaces for use by other system services.

CGColorSpace

A profile that specifies how to interpret a color value for display.

CGContext

A Quartz 2D drawing destination.

CGDataConsumer

An abstraction for data-writing tasks that eliminates the need to manage a raw memory buffer.

CGDataProvider

An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer.

CGFont

A set of character glyphs and layout information for drawing text.

CGFunction

A general facility for defining and using callback functions.

CGGLContext

Deprecated. A type of CGContextRef for drawing OpenGL content.

CGGradient

A definition for a smooth transition between colors for drawing radial and axial gradient fills.

CGImage

A bitmap image or image mask.

CGLayer

An offscreen context for reusing content drawn with Core Graphics.

CGPath

Immutable and mutable types for graphics paths: mathematical descriptions of shapes or lines to be drawn in a graphics context.

CGPattern

A 2D pattern to be used for drawing graphics paths.

CGPDFArray

An array structure within a PDF document.

CGPDFContentStream

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

CGPDFContext

A type of CGContextRef for drawing PDF content.

CGPDFDictionary

A dictionary structure within a PDF document.

CGPDFObject

An object representing content within a PDF document.

CGPDFOperatorTable

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

CGPDFPage

A page in a PDF document.

CGPDFScanner

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

CGPDFStream

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

CGPDFString

A text string in a PDF document.

CGPSConverter

An object that converts PostScript data to PDF data.

CGShading

A definition for a smooth transition between colors, controlled by a custom function you provide, for drawing radial and axial gradient fills.