PSPDFDocumentPDFMetadata


@interface PSPDFDocumentPDFMetadata : NSObject

This class allows you to modify a PDF documents metadata. Metadata is defined in two ways in the PDF spec (ยง 14.3):

Info dictionary support

All values specified in the Info dictionary are represented by the following types:

  • NSString
  • NSNumber
  • NSDate
  • NSArray<id>: can include any of the types mentioned.
  • NSDictionary<NSString*, id>: value can be any of the types mentioned.

These types can be combined in any way you see fit and it will be converted into the proper PDF types.

Note

The PDF stream type is not yet supported.
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFDocumentPDFMetadata : NSObject
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFDocumentPDFMetadata : NSObject
  • Initializes the PSPDFDocumentPDFMetadata with a document. The document needs to be valid. If its not, reading or setting values will fail gracefully. - note: If document is a compound document, this will provide access to ONLY the first PSPDFDocumentProvider.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDocument:(nonnull PSPDFDocument *)document;

    Swift

    convenience init(document: PSPDFDocument)
  • Initializes the PSPDFDocumentPDFMetadata with a document provider.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDocumentProvider:
        (nonnull PSPDFDocumentProvider *)documentProvider;

    Swift

    init(documentProvider: PSPDFDocumentProvider)
  • Provides access to the document this instance is handling.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFDocument *_Nonnull document;

    Swift

    var document: PSPDFDocument { get }
  • Provides access to the document provider this instance is handling.

    Declaration

    Objective-C

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

    Swift

    var documentProvider: PSPDFDocumentProvider { get }
  • Returns a list of all the keys set in the Info dictionary.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSArray<NSString *> *_Nonnull allInfoKeys;

    Swift

    var allInfoKeys: [String] { get }
  • Returns the object that is set in the Info dictionary for key

    Note

    Please see the class documentation for types that might be returned.

    Declaration

    Objective-C

    - (nullable id)objectForInfoDictionaryKey:(nonnull NSString *)key;

    Swift

    func object(forInfoDictionaryKey key: String) -> Any?
  • Sets the given object in the Info dictionary for key.

    Note

    Please see the class documentation for valid types for value. If you pass a invalid type, a exception will be raised.

    Declaration

    Objective-C

    - (void)setObject:(nullable id)object
        forInfoDictionaryKey:(nonnull NSString *)key;

    Swift

    func setObject(_ object: Any?, forInfoDictionaryKey key: String)
  • Allows generic array access.

    Declaration

    Objective-C

    - (nullable id)objectForKeyedSubscript:(nonnull id)key;

    Swift

    subscript(key: Any) -> Any! { get }
  • Allows generic array access.

    Declaration

    Objective-C

    - (void)setObject:(nonnull id)object
        forKeyedSubscript:(nonnull id<NSCopying>)key;

    Swift

    func setObject(_ object: Any, forKeyedSubscript key: NSCopying)