PSPDFImageInfo


@interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>

Defines the position if an image in the PDF. - note: This class should not be manually instantated. Use PSPDFTextParser to fetch images.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>
  • Content ID of the image in the page stream.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger index;

    Swift

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

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGSize pixelSize;

    Swift

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

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGAffineTransform transform;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get }
  • Declaration

    Objective-C

    @property (readonly, nonatomic) CGSize displaySize;

    Swift

    var displaySize: CGSize { get }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFImageInfo : NSObject <NSCopying, NSSecureCoding>
  • 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 (readonly, nonatomic) 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 UIImage *)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 UIImage *)imageInRGBColorSpaceWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func imageInRGBColorSpace() throws -> NSImage