PTTextWidgetRefreshAppearanceHandler
@interface PTTextWidgetRefreshAppearanceHandler
: PTAnnotationRefreshCustomAppearanceHandler
A PTTextWidgetRefreshAppearanceHandler
generates custom PDF appearances for text widget annotations.
-
Initializes a
PTTextWidgetRefreshAppearanceHandler
instance.Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
Return Value
An initialized
PTTextWidgetRefreshAppearanceHandler
instance.
-
Draws the background for the text widget annotation.
The default implementation of the method fills the bounds of the background with the annotation’s background color.
Declaration
Objective-C
- (void) drawBackgroundForTextWidget:(nonnull PTTextWidget *)textWidget inRect:(nonnull PTPDFRect *)backgroundRect withBuilder:(nonnull PTElementBuilder *)elementBuilder writer:(nonnull PTElementWriter *)elementWriter userInfo: (nullable NSDictionary< PTAnnotationRefreshAppearanceUserInfoKey, id> *) userInfo;
Swift
func drawBackground(for textWidget: PTTextWidget, in backgroundRect: PTPDFRect, with elementBuilder: PTElementBuilder, writer elementWriter: PTElementWriter, userInfo: [PTAnnotationRefreshAppearanceUserInfoKey : Any]? = nil)
Parameters
textWidget
The text widget annotation for which an appearance is being generated.
backgroundRect
The bounds of the background to be drawn.
elementBuilder
The element builder used to create new content stream elements.
elementWriter
The element writer used to write new elements to the output content stream.
userInfo
A dictionary containing additional information, or
nil
. -
Draws the content (text) of the text widget annotation.
Declaration
Objective-C
- (void)drawContentsForTextWidget:(nonnull PTTextWidget *)textWidget inRect:(nonnull PTPDFRect *)contentRect withBuilder:(nonnull PTElementBuilder *)elementBuilder writer:(nonnull PTElementWriter *)elementWriter userInfo:(nullable NSDictionary< PTAnnotationRefreshAppearanceUserInfoKey, id> *)userInfo;
Swift
func drawContents(for textWidget: PTTextWidget, in contentRect: PTPDFRect, with elementBuilder: PTElementBuilder, writer elementWriter: PTElementWriter, userInfo: [PTAnnotationRefreshAppearanceUserInfoKey : Any]? = nil)
Parameters
textWidget
The text widget annotation for which an appearance is being generated.
contentRect
The bounds of the content (text) to be drawn.
elementBuilder
The element builder used to create new content stream elements.
elementWriter
The element writer used to write new elements to the output content stream.
userInfo
A dictionary containing additional information, or
nil
. -
Draws the border of the text widget annotation.
The default implementation of this method strokes the border with the annotation’s border color.
Declaration
Objective-C
- (void)drawBorderForTextWidget:(nonnull PTTextWidget *)textWidget inRect:(nonnull PTPDFRect *)borderRect withBuilder:(nonnull PTElementBuilder *)elementBuilder writer:(nonnull PTElementWriter *)elementWriter userInfo: (nullable NSDictionary< PTAnnotationRefreshAppearanceUserInfoKey, id> *) userInfo;
Swift
func drawBorder(for textWidget: PTTextWidget, in borderRect: PTPDFRect, with elementBuilder: PTElementBuilder, writer elementWriter: PTElementWriter, userInfo: [PTAnnotationRefreshAppearanceUserInfoKey : Any]? = nil)
Parameters
textWidget
The text widget annotation for which an appearance is being generated.
borderRect
The bounds of the border to be drawn. The entire border is drawn within this rectangle (ie. the rectangle is inset on all sides by half of the border width).
elementBuilder
The element builder used to create new content stream elements.
elementWriter
The element writer used to write new elements to the output content stream.
userInfo
A dictionary containing additional information, or
nil
.