PSPDFImageInfo

Objective-C


@interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>

Swift

class ImageInfo : NSObject, NSCopying, NSSecureCoding

Defines the position if an image in the PDF.

Note

This class should not be manually instantiated. Use PSPDFTextParser to fetch images.
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Content ID of the image in the page stream.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger index;

    Swift

    var index: UInt { get }
  • The pixel size of the image.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGSize pixelSize;

    Swift

    var pixelSize: CGSize { get }
  • Transform that is applied to the image.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGAffineTransform transform;

    Swift

    var transform: CGAffineTransform { get }
  • The 4 points that define the image. (Boxed CGPoint)

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<NSValue *> *_Nonnull vertices;

    Swift

    var vertices: [NSValue] { get }
  • Associated document provider.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) PSPDFDocumentProvider *_Nullable documentProvider;

    Swift

    weak var documentProvider: PSPDFDocumentProvider? { get }
  • Page is relative to the document provider.

    Declaration

    Objective-C

    @property (nonatomic, readonly) PSPDFPageIndex pageIndex;

    Swift

    var pageIndex: PageIndex { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGSize displaySize

    Swift

    var displaySize: CGSize { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat horizontalResolution

    Swift

    var horizontalResolution: CGFloat { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat verticalResolution

    Swift

    var verticalResolution: CGFloat { get }
  • Hit-Testing.

    Declaration

    Objective-C

    - (BOOL)hitTest:(CGPoint)point;

    Swift

    func hitTest(_ point: CGPoint) -> Bool
  • Rect that spans the 4 points.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGRect boundingBox;

    Swift

    var boundingBox: CGRect { get }
  • The actual image. Will be extracted on the fly. Might have other dimensions than the displayed dimensions.

    Declaration

    Objective-C

    - (nullable NSImage *)imageWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func image() throws -> NSImage
  • Some PDF images are in CMYK color space, which is not a supported encoding. (UIImageJPEGRepresentation will return nil in that case) This method checks against this case and converts the image into RGB color space.

    Declaration

    Objective-C

    - (nullable NSImage *)imageInRGBColorSpaceWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func imageInRGBColorSpace() throws -> NSImage