PTInk
@interface PTInk : PTMarkup
An ink annotation (PDF 1.3) represents a freehand “scribble” composed of one or more disjoint paths. When opened, it shall display a pop-up window containing the text of the associated note.
-
Creates an Ink annotation and initializes it using given Cos/SDF object.
Note
The constructor does not copy any data, but is instead the logical equivalent of a type cast.Parameters
d
The Cos/SDF object to initialze the annotation with.
-
Undocumented
Declaration
Objective-C
- (instancetype)init;
Swift
init!()
-
Creates a new Ink annotation in the specified document.
Declaration
Parameters
doc
A document to which the Ink annotation is added.
pos
A rectangle specifying the Ink annotation’s bounds in default user space units.
Return Value
A newly created blank Ink annotation.
-
Returns number of paths in the annotation.
Note
Each path is an array of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.Declaration
Objective-C
- (int)GetPathCount;
Swift
func getPathCount() -> Int32
Return Value
An integer representing the number of paths in the ‘InkList’ entry of the annotation dictionary.
-
Returns number of points in a certain stroked path in the InkList.
See
GetPathCount()Declaration
Objective-C
- (int)GetPointCount:(unsigned int)pathindex;
Swift
func getPointCount(_ pathindex: UInt32) -> Int32
Parameters
pathindex
path index for each the point count is returned. Index starts at 0.
Return Value
An integer representing the number of points in the stroked path of the Ink list.
-
Returns the specific point in a given path.
Note
Each path is an array of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.Declaration
Objective-C
- (PTPDFPoint *)GetPoint:(unsigned int)pathindex pointindex:(unsigned int)pointindex;
Swift
func getPoint(_ pathindex: UInt32, pointindex: UInt32) -> PTPDFPoint!
Parameters
pathindex
path index for each the point is returned. Index starts at 0.
pointindex
index of point in the path. Index starts at 0.
Return Value
A Point object for specified path and point index.
-
Sets the specific point in the Ink List, adding it if needed.
Note
Ink annotation contains an array of paths. Each path is an array of Point objects specifying points along the path. When drawn, the points shall be connected by straight lines or curves in an implementation-dependent way.Declaration
Objective-C
- (void)SetPoint:(unsigned int)pathindex pointindex:(unsigned int)pointindex pt:(PTPDFPoint *)pt;
Swift
func setPoint(_ pathindex: UInt32, pointindex: UInt32, pt: PTPDFPoint!)
Parameters
pathindex
An unsigned integer indicating the index of the path.
pointindex
An unsigned integer indicating the index of the point within the stroked path indicated by the parameter “pathindex”.
pt
A Point object that is to be assigned.
-
Erase a rectangle area formed by pt1pt2 with width
Declaration
Objective-C
- (BOOL)Erase:(PTPDFPoint *)pt1 pt2:(PTPDFPoint *)pt2 width:(double)width;
Swift
func erase(_ pt1: PTPDFPoint!, pt2: PTPDFPoint!, width: Double) -> Bool
Parameters
pt1
A point object that is one end of the eraser segment
pt2
A point object that is the other end of the eraser segment
width
The half width of the eraser
Return Value
Whether an ink stroke was erased
-
Retrieves whether the Ink will draw like a highlighter.
Declaration
Objective-C
- (BOOL)GetHighlightIntent;
Swift
func getHighlightIntent() -> Bool
Return Value
true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode)
-
Enables or disables the Ink drawing like a highlighter.
Declaration
Objective-C
- (void)SetHighlightIntent:(BOOL)highlight;
Swift
func setHighlightIntent(_ highlight: Bool)
Parameters
highlight
true if the Ink will draw like a highlighter. (multiply blend mode) If false it will draw in normal mode. (normal blend mode)