Mac Developer Library

Developer

AppKit Framework Reference NSPDFImageRep Class Reference

Options
Deployment Target:

On This Page
Language:

NSPDFImageRep

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

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

    Declaration

    Objective-C

    + (instancetype)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.

  • Returns an NSPDFImageRep object initialized with the specified PDF data.

    Declaration

    Swift

    init?(data pdfData: NSData)

    Objective-C

    - (instancetype)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.

  • The receiver's bounding rectangle. (read-only)

    Declaration

    Swift

    var bounds: NSRect { get }

    Objective-C

    @property(readonly) NSRect bounds

    Discussion

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

    Availability

    Available in OS X v10.0 and later.

  • The page currently displayed by the image representation.

    Declaration

    Swift

    var currentPage: Int

    Objective-C

    @property NSInteger currentPage

    Availability

    Available in OS X v10.0 and later.

  • The number of pages in the receiver. (read-only)

    Declaration

    Swift

    var pageCount: Int { get }

    Objective-C

    @property(readonly) NSInteger pageCount

    Availability

    Available in OS X v10.0 and later.

  • The PDF representation of the receiver's image. (read-only)

    Declaration

    Swift

    var PDFRepresentation: NSData { get }

    Objective-C

    @property(readonly, strong) NSData *PDFRepresentation

    Availability

    Available in OS X v10.0 and later.