PTPDFDocumentManager
@interface PTPDFDocumentManager : NSObject <PTOverridable>
Instances of the PTPDFDocumentManager class control how documents are accessed, usually by a
viewer component.
-
Initializes a new
PTPDFDocumentManagerinstance.Declaration
Objective-C
- (nonnull instancetype)init;Swift
init()Return Value
an initialized
PTPDFDocumentManagerinstance -
The delegate object of the
PTPDFDocumentManager.Note
The default value of this property isnil.Declaration
Objective-C
@property (nonatomic, weak, nullable) id<PTPDFDocumentManagerDelegate> delegate;Swift
weak var delegate: (any PTPDFDocumentManagerDelegate)? { get set }
-
The documents being managed by this
PTPDFDocumentManager.Note
The default value of this property isnil.Declaration
Objective-C
@property (nonatomic, copy, readonly, nullable) NSArray<PTPDFDocumentFile *> *documents;Swift
var documents: [PTPDFDocumentFile]? { get } -
Creates and returns a new
PTPDFDocumentFileinstance for the file at the given URL.Note
The document is not added to the list of documents in
PTPDFDocumentManager.documents.Declaration
Objective-C
- (nonnull PTPDFDocumentFile *)makeDocumentForURL:(nonnull NSURL *)url;Swift
func makeDocument(for url: URL) -> PTPDFDocumentFileParameters
urlThe URL of the file for which a document is to be created.
Return Value
A new
PTPDFDocumentFileinstance for the file. -
Returns the document whose file is located by the specified URL.
Declaration
Objective-C
- (nullable PTPDFDocumentFile *)documentForURL:(nonnull NSURL *)url;Swift
func document(for url: URL) -> PTPDFDocumentFile?Parameters
urlThe URL of the document to retrieve.
Return Value
The document for the specified URL, or
nilif there is no such document. -
Adds the given document to the list of managed documents.
Declaration
Objective-C
- (void)addDocument:(nonnull PTPDFDocumentFile *)document;Swift
func addDocument(_ document: PTPDFDocumentFile)Parameters
documentThe document to add.
-
Removes the given document from the list of managed documents.
Declaration
Objective-C
- (void)removeDocument:(nonnull PTPDFDocumentFile *)document;Swift
func removeDocument(_ document: PTPDFDocumentFile)Parameters
documentThe document to remove.
-
The URL of the directory where documents are cached.
The document cache is used for remote (HTTP) file downloads, documents converted from other formats, and any other document-related operation that needs a safe location on-disk.
The default value of this property is the return value of the class method
+[PTPDFDocumentManager defaultDocumentCacheDirectoryURLWithError:].Declaration
Objective-C
@property (nonatomic, strong) NSURL *_Nonnull documentCacheDirectoryURL;Swift
var documentCacheDirectoryURL: URL { get set } -
Returns the URL of the default directory used for caching documents.
Note
In Swift, this method returns
Voidand is marked with thethrowskeyword to indicate that it throws an error in cases of failure.Declaration
Objective-C
+ (nullable NSURL *)defaultDocumentCacheDirectoryURLWithError: (out NSError *_Nullable *_Nullable)outError;Swift
class func defaultDocumentCacheDirectoryURL() throws -> URLParameters
outErrorOn input, a pointer to an error object. If an error occurs , this pointer is set to an actual error object containing the error information. You may specify
nilfor this parameter if you do not want the error information.Return Value
the default document cache directory URL, or
nilif an error occurred
PTPDFDocumentManager Class Reference