YLAnnotation Class Reference
Inherits from | NSObject |
Declared in | YLAnnotation.h YLAnnotation.m |
Tasks
-
rect
Rectangle of the annotation in pdf coordinates.
property -
page
Page number of the annotation.
property -
targetPage
This holds the target page number if the annotation is of type kAnnotationTypePage.
property -
uri
The complete original url as it appears in the annotation.
property -
url
This is the parsed url that will point to web pages or remote audio/video.
property -
params
Dictionary holding the parameters that were passed in the annotation url.
property -
local
Boolean value that specifies wether the audio/video annotation’s content is local or remote.
property -
document
Reference to the YLDocument object.
property -
type
Type of the annotation.
property -
+ convertPDFPointToViewPoint:renderRect:pageInfo:
Converts a point from PDF coordinates to view coordinates.
-
+ convertViewPointToPDFPoint:renderRect:pageInfo:
Converts a point from view coordinates to PDF coordinates.
-
+ convertPDFRect:forRect:pageInfo:
Converts a rectangle from PDF coordinates to view coordinates.
-
– initWithDocument:dictionary:page:
Initializes a YLAnnotation object and returns it to the caller.
-
– viewRectForRect:
Converts the rectangle of the annotation to view coordinates using the passed rect parameter as the target container rectangle.
Properties
document
Reference to the YLDocument object.
@property (nonatomic, assign) YLDocument *document
Discussion
Reference to the YLDocument object.
Declared In
YLAnnotation.h
local
Boolean value that specifies wether the audio/video annotation’s content is local or remote.
@property (nonatomic, readonly) BOOL local
Discussion
Boolean value that specifies wether the audio/video annotation’s content is local or remote.
Declared In
YLAnnotation.h
page
Page number of the annotation.
@property (nonatomic, readonly) NSUInteger page
Discussion
Page number of the annotation.
Declared In
YLAnnotation.h
params
Dictionary holding the parameters that were passed in the annotation url.
@property (nonatomic, readonly) NSDictionary *params
Discussion
Dictionary holding the parameters that were passed in the annotation url.
Declared In
YLAnnotation.h
rect
Rectangle of the annotation in pdf coordinates.
@property (nonatomic, readonly) CGRect rect
Discussion
Rectangle of the annotation in pdf coordinates.
Declared In
YLAnnotation.h
type
Type of the annotation.
@property (nonatomic, readonly) AnnotationType type
Discussion
Type of the annotation.
Declared In
YLAnnotation.h
Class Methods
convertPDFPointToViewPoint:renderRect:pageInfo:
Converts a point from PDF coordinates to view coordinates.
+ (CGPoint)convertPDFPointToViewPoint:(CGPoint)pdfPoint renderRect:(CGRect)renderRect pageInfo:(YLPageInfo *)pageInfo
Parameters
- pdfPoint
Point in PDF coordinates.
- renderRect
Target rectangle that will hold the point.
- pageInfo
YLPageInfo object of the page that contains the point.
Return Value
Point that is converted to view coordinates.
Discussion
Converts a point from PDF coordinates to view coordinates.
Declared In
YLAnnotation.h
convertPDFRect:forRect:pageInfo:
Converts a rectangle from PDF coordinates to view coordinates.
+ (CGRect)convertPDFRect:(CGRect)pdfRect forRect:(CGRect)renderRect pageInfo:(YLPageInfo *)pageInfo
Parameters
- pdfRect
Rectangle in PDF coordinates.
- renderRect
Target view rectangle.
- pageInfo
YLPageInfo object of the page that contains the rectangle.
Return Value
Rectangle that is converted to view coordinates.
Discussion
Converts a rectangle from PDF coordinates to view coordinates.
Declared In
YLAnnotation.h
convertViewPointToPDFPoint:renderRect:pageInfo:
Converts a point from view coordinates to PDF coordinates.
+ (CGPoint)convertViewPointToPDFPoint:(CGPoint)viewPoint renderRect:(CGRect)renderRect pageInfo:(YLPageInfo *)pageInfo
Parameters
- viewPoint
Point in view coordinates.
- renderRect
Target rectangle that will hold the point.
- pageInfo
YLPageInfo object of the page that contains the point.
Return Value
Point that is converted to PDF coordinates.
Discussion
Converts a point from view coordinates to PDF coordinates.
Declared In
YLAnnotation.h
Instance Methods
initWithDocument:dictionary:page:
Initializes a YLAnnotation object and returns it to the caller.
- (id)initWithDocument:(CGPDFDocumentRef)document dictionary:(CGPDFDictionaryRef)dictionary page:(NSUInteger)page
Parameters
- document
Reference to the CGPDF document object.
- dictionary
Dictionary that holds all the information about the annotation.
- page
Page number of the annotation.
Return Value
An initialized YLAnnotation object.
Discussion
Initializes a YLAnnotation object and returns it to the caller.
Declared In
YLAnnotation.h
viewRectForRect:
Converts the rectangle of the annotation to view coordinates using the passed rect parameter as the target container rectangle.
- (CGRect)viewRectForRect:(CGRect)rect
Parameters
- rect
The target container rectangle. This could be the bounds rectangle of the UIView where the PDF page is rendered in for example.
Return Value
Rectangle converted to view coordinates.
Discussion
Converts the rectangle of the annotation to view coordinates using the passed rect parameter as the target container rectangle.
Declared In
YLAnnotation.h