PSPDFImageDocument


@interface PSPDFImageDocument : PSPDFDocument

A PSPDFDocument subclass that can be used to display and annotate image files. Can handle JPEG and PNG images.

Note

Any transparency on PNG images will be lost after saving.

Saving changes flattens any annotations into the image and writes it back to the original file. Creating a new document will then reflect the new image with flattened changes. Keep the image document in memory to preserve the ability to edit added annotations.

  • Creates a new image document.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithImageURL:(nonnull NSURL *)imageURL;

    Swift

    init(imageURL: URL)

    Parameters

    imageURL

    A local file URL of the image.

    Return Value

    A new image document instance.

  • The image URL, if initialized via initWithImageURL:.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSURL *imageURL;

    Swift

    var imageURL: URL? { get }
  • The compression quality for writing JPEG images.

    Bound to a value between 0.0 (most compression) and 1.0 (least compression). Defaults to 1.0 - best image quality and largest image size.

    Note

    We recommend using a large compressionQuality value to prevent quality degradation during subsequent editing sessions.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat compressionQuality;

    Swift

    var compressionQuality: CGFloat { get set }
  • A set containing UTI types suported by the image document class.

    Declaration

    Objective-C

    @property (readonly, nonatomic, class)
        NSSet<NSString *> *_Nonnull supportedContentTypes;

    Swift

    class var supportedContentTypes: Set
  • The image is loaded and coverted to PDF asynchronously. Use this call to wait until the process is complete.

    Declaration

    Objective-C

    - (void)waitUntilLoaded;

    Swift

    func waitUntilLoaded()