Mac Developer Library

Developer

AppKit Framework Reference NSPDFImageRep Class Reference

Options
Deployment Target:

On This Page
Language:

NSPDFImageRep

Inheritance


Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.

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

    Swift

    convenience init!(data pdfData: NSData!)

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the receiver's bounding rectangle.

    Declaration

    Swift

    var bounds: NSRect { get }

    Objective-C

    @property(readonly) NSRect bounds

    Return Value

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Gets the page currently displayed by the image representation.

    Declaration

    Swift

    var currentPage: Int

    Objective-C

    @property NSInteger currentPage

    Return Value

    A zero-based index indicating the page being displayed.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the number of pages in the receiver.

    Declaration

    Swift

    var pageCount: Int { get }

    Objective-C

    @property(readonly) NSInteger pageCount

    Return Value

    The number of pages in the PDF data.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the PDF representation of the receiver's image.

    Declaration

    Swift

    var PDFRepresentation: NSData { get }

    Objective-C

    @property(readonly, strong) NSData *PDFRepresentation

    Return Value

    The PDF data used to create the receiver.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the page to display to the specified value.

    Declaration

    Swift

    var currentPage: Int

    Objective-C

    @property NSInteger currentPage

    Parameters

    page

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – currentPage