NSPDFImageRep Class Reference

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

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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
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
  • Available in OS X v10.0 and later.
Declared In
NSPDFImageRep.h