YLDocument Class Reference
Inherits from | NSObject |
Declared in | YLDocument.h YLDocument.m |
Tasks
Other Methods
-
uuid
UUID string value that is used internally to construct file paths for the thumbnails and bookmarks. Bookmarks are saved in Documents/Private Docs/Bookmarks/uuid.plist All thumbnail images are saved to NSCachesDirectory/YLPDFKit/uuid/
property -
path
Path of the PDF file.
property -
title
Title of the PDF file. This is basically the filename minus the extension.
property -
password
Password to unlock the PDF file if it’s encrypted.
property -
locked
Boolean value that specifies wether the PDF file is locked or not. You can use this property to see if a PDF file is encrypted.
property -
validPDF
Boolean value that specifies if the document is a valid PDF file.
property -
pageCount
Number of pages in the PDF file.
property -
outlineParser
Returns the outline parser for this document.
property -
scanner
Returns the scanner you can use to search for text in this document.
property -
annotationParser
Returns the annotation parser.
property
Initialization Methods
-
+ YLDocumentWithFilePath:
Initializes a YLDocument instance and returns it to the caller.
-
– initWithFilePath:
Initializes a YLDocument instance and returns it to the caller.
Encryption Methods
-
– unlockWithPassword:
Use this function to unlock an encrypted PDF file.
Query Methods
-
– pageInfoForPage:
Returns a YLPageInfo object for the requested page that holds information about the page rectangle and rotation. The YLPageInfo is cached for future access.
-
– requestDocumentRef
Returns a CGPDF reference for this document. When you’re finished using this reference you should release it using the CGPDFDocumentRelease function.
Bookmark Methods
-
– addBookmarkForPage:
Adds bookmark for the requested page.
-
– removeBookmarkForPage:
Removes bookmark for the requested page.
-
– hasBookmarkForPage:
Use this function to query if there is a bookmark for a specific page.
-
– bookmarkedPageNumbers
Returns a sorted array of all bookmarked pages.
Properties
annotationParser
Returns the annotation parser.
@property (nonatomic, readonly) YLAnnotationParser *annotationParser
Discussion
Returns the annotation parser.
Declared In
YLDocument.h
locked
Boolean value that specifies wether the PDF file is locked or not. You can use this property to see if a PDF file is encrypted.
@property (nonatomic, assign, readonly, getter=isLocked) BOOL locked
Discussion
Boolean value that specifies wether the PDF file is locked or not. You can use this property to see if a PDF file is encrypted.
Declared In
YLDocument.h
outlineParser
Returns the outline parser for this document.
@property (nonatomic, readonly) YLOutlineParser *outlineParser
Discussion
Returns the outline parser for this document.
Declared In
YLDocument.h
pageCount
Number of pages in the PDF file.
@property (nonatomic, readonly) NSUInteger pageCount
Discussion
Number of pages in the PDF file.
Declared In
YLDocument.h
password
Password to unlock the PDF file if it’s encrypted.
@property (nonatomic, copy) NSString *password
Discussion
Password to unlock the PDF file if it’s encrypted.
Declared In
YLDocument.h
path
Path of the PDF file.
@property (nonatomic, readonly) NSString *path
Discussion
Path of the PDF file.
Declared In
YLDocument.h
scanner
Returns the scanner you can use to search for text in this document.
@property (nonatomic, readonly) YLDocumentScanner *scanner
Discussion
Returns the scanner you can use to search for text in this document.
Declared In
YLDocument.h
title
Title of the PDF file. This is basically the filename minus the extension.
@property (nonatomic, copy) NSString *title
Discussion
Title of the PDF file. This is basically the filename minus the extension.
Declared In
YLDocument.h
uuid
UUID string value that is used internally to construct file paths for the thumbnails and bookmarks. Bookmarks are saved in Documents/Private Docs/Bookmarks/uuid.plist All thumbnail images are saved to NSCachesDirectory/YLPDFKit/uuid/
@property (nonatomic, readonly) NSString *uuid
Discussion
UUID string value that is used internally to construct file paths for the thumbnails and bookmarks. Bookmarks are saved in Documents/Private Docs/Bookmarks/uuid.plist All thumbnail images are saved to NSCachesDirectory/YLPDFKit/uuid/
Declared In
YLDocument.h
Class Methods
YLDocumentWithFilePath:
Initializes a YLDocument instance and returns it to the caller.
+ (YLDocument *)YLDocumentWithFilePath:(NSString *)path
Parameters
- path
Filesystem path to the PDF file.
Return Value
An initialized YLDocument instance.
Discussion
Initializes a YLDocument instance and returns it to the caller.
Declared In
YLDocument.h
Instance Methods
addBookmarkForPage:
Adds bookmark for the requested page.
- (BOOL)addBookmarkForPage:(NSUInteger)page
Parameters
- page
Page number starting from 0.
Return Value
YES if the bookmark is added, NO if the page is invalid.
Discussion
Adds bookmark for the requested page.
Declared In
YLDocument.h
bookmarkedPageNumbers
Returns a sorted array of all bookmarked pages.
- (NSArray *)bookmarkedPageNumbers
Return Value
Sorted NSArray with all bookmarked pages.
Discussion
Returns a sorted array of all bookmarked pages.
Declared In
YLDocument.h
hasBookmarkForPage:
Use this function to query if there is a bookmark for a specific page.
- (BOOL)hasBookmarkForPage:(NSUInteger)page
Parameters
- page
Page number starting from 0.
Return Value
YES if there is a bookmark for this page.
Discussion
Use this function to query if there is a bookmark for a specific page.
Declared In
YLDocument.h
initWithFilePath:
Initializes a YLDocument instance and returns it to the caller.
- (id)initWithFilePath:(NSString *)path
Parameters
- path
Filesystem path to the PDF file.
Return Value
An initialized YLDocument instance.
Discussion
Initializes a YLDocument instance and returns it to the caller.
Declared In
YLDocument.h
pageInfoForPage:
Returns a YLPageInfo object for the requested page that holds information about the page rectangle and rotation. The YLPageInfo is cached for future access.
- (YLPageInfo *)pageInfoForPage:(NSUInteger)page
Parameters
- page
Page number starting from 0.
Return Value
An initialized YLPageInfo object or nil when the page number is invalid.
Discussion
Returns a YLPageInfo object for the requested page that holds information about the page rectangle and rotation. The YLPageInfo is cached for future access.
Declared In
YLDocument.h
removeBookmarkForPage:
Removes bookmark for the requested page.
- (BOOL)removeBookmarkForPage:(NSUInteger)page
Parameters
- page
Page number starting from 0.
Return Value
YES if the bookmark is removed, NO if the page is invalid or if there was no bookmark to remove.
Discussion
Removes bookmark for the requested page.
Declared In
YLDocument.h
requestDocumentRef
Returns a CGPDF reference for this document. When you’re finished using this reference you should release it using the CGPDFDocumentRelease function.
- (CGPDFDocumentRef)requestDocumentRef
Discussion
Returns a CGPDF reference for this document. When you’re finished using this reference you should release it using the CGPDFDocumentRelease function.
Declared In
YLDocument.h
unlockWithPassword:
Use this function to unlock an encrypted PDF file.
- (BOOL)unlockWithPassword:(NSString *)password
Parameters
- password
Password to use for unlocking the PDF file.
Return Value
YES if successfully unlocked, otherwise NO.
Discussion
Use this function to unlock an encrypted PDF file.
Declared In
YLDocument.h