Next Page > Hide TOC

NSPDFImageRep Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSPDFImageRep.h
Related sample code

Overview

An NSPDFImageRep object can render an image from a PDF format data stream.

Tasks

Creating an NSPDFImageRep

Getting Image Data

Class Methods

imageRepWithData:

Creates and returns an NSPDFImageRep object initialized with the specified PDF data.

+ (id)imageRepWithData:(NSData *)pdfData

Parameters
pdfData

A data object containing the PDF data for the image.

Return Value

An initialized NSPDFImageRep object or nil if the object could not be initialized. Initialization may fail if the PDF data does not conform to the PDF file format.

Availability
See Also
Declared In
NSPDFImageRep.h

Instance Methods

bounds

Returns the receiver's bounding rectangle.

- (NSRect)bounds

Return Value

The bounding rectangle. This value is equivalent to the crop box specified by the PDF data.

Availability
Related Sample Code
Declared In
NSPDFImageRep.h

currentPage

Gets the page currently displayed by the image representation.

- (NSInteger)currentPage

Return Value

A zero-based index indicating the page being displayed.

Availability
See Also
Declared In
NSPDFImageRep.h

initWithData:

Returns an NSPDFImageRep object initialized with the specified PDF data.

- (id)initWithData:(NSData *)pdfData

Parameters
pdfData

A data object containing the PDF data for the image.

Return Value

An initialized NSPDFImageRep object or nil if the object could not be initialized. Initialization may fail if the PDF data does not conform to the PDF file format.

Availability
See Also
Declared In
NSPDFImageRep.h

pageCount

Returns the number of pages in the receiver.

- (NSInteger)pageCount

Return Value

The number of pages in the PDF data.

Availability
Related Sample Code
Declared In
NSPDFImageRep.h

PDFRepresentation

Returns the PDF representation of the receiver's image.

- (NSData *)PDFRepresentation

Return Value

The PDF data used to create the receiver.

Availability
Declared In
NSPDFImageRep.h

setCurrentPage:

Sets the page to display to the specified value.

- (void)setCurrentPage:(NSInteger)page

Parameters
page

A zero-based index indicating the page you want to display.

Availability
See Also
Related Sample Code
Declared In
NSPDFImageRep.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-26)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.