PSPDFFile

Undocumented

  • Initialize with a name and an URL or data. (do not set both, but needs at least one)

    Declaration

    Objective-C

    - (nonnull instancetype)initWithName:(nonnull NSString *)fileName
                                     URL:(nullable NSURL *)fileURL
                                    data:(nullable NSData *)fileData;

    Swift

    init(name fileName: String, url fileURL: URL?, data fileData: Data?)
  • The name of the file.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull fileName;

    Swift

    var fileName: String { get }
  • The location of the file.

    Declaration

    Objective-C

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

    Swift

    var fileURL: URL? { get }
  • Data representation. If not set at construction time, we try to memory-map it on access.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSData *fileData;

    Swift

    var fileData: Data? { get }
  • The mime type of the document as derived from fileName, falling back to application/pdf if no mime type could be derived.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull mimeType;

    Swift

    var mimeType: String { get }
  • Returns either the set data, or a memory-mapped version of fileURL. Guaranteed to not return an empty NSData object.

    Declaration

    Objective-C

    - (nullable NSData *)fileDataMappedWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func fileDataMapped() throws -> Data