PTAnnotStyle


@interface PTAnnotStyle : NSObject <NSCopying, NSCoding, PTOverridable>

This class wraps a PTAnnot and is used to store style appearance and property information before the information is saved back to the annotation.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotType:(PTExtendedAnnotType)annotType;

    Swift

    init(annotType: PTExtendedAnnotType)

    Parameters

    annotType

    The annotation type used to initalize this object’s properties.

  • Returns a new instance of an AnnotStyle for reflow webview.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotTypeForWebView:
        (PTExtendedAnnotType)annotType;

    Swift

    init(annotTypeForWebView annotType: PTExtendedAnnotType)

    Parameters

    annotType

    The annotation type used to initalize this object’s properties.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnot:(nonnull PTAnnot *)annot;

    Swift

    convenience init(annot: PTAnnot)

    Parameters

    annot

    The annotation used to initialize this object’s properties.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnot:(nonnull PTAnnot *)annot
                                 onPDFDoc:(nullable PTPDFDoc *)pdfDoc;

    Swift

    init(annot: PTAnnot, on pdfDoc: PTPDFDoc?)

    Parameters

    annot

    The annotation used to initialize this object’s properties.

    pdfDoc

    The PTPDFDoc which the annotation is part of. This is required to change a PTFreeText‘s font.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init(coder: NSCoder)

    Parameters

    coder

    The coder used to initialize this object’s properties.

  • The annotation type whose style appearance and properties are being controlled by this object.

    Declaration

    Objective-C

    @property (nonatomic, readonly) PTExtendedAnnotType annotType;

    Swift

    var annotType: PTExtendedAnnotType { get }
  • The annotation whose style appearance and properties are being controlled by this object.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) PTAnnot *annot;

    Swift

    var annot: PTAnnot? { get }
  • A list of the currently available style keys for the annotation type.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<PTAnnotStyleKey> *_Nonnull availableStyleKeys;

    Swift

    var availableStyleKeys: [PTAnnotStyleKey] { get }
  • The color of the annotation. This is also an alias for the stroke color.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *color;

    Swift

    var color: UIColor? { get set }
  • The stroke color of the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *strokeColor;

    Swift

    var strokeColor: UIColor? { get set }
  • The fill color of the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *fillColor;

    Swift

    var fillColor: UIColor? { get set }
  • The text color of a free text annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *textColor;

    Swift

    var textColor: UIColor? { get set }
  • The line, stroke, or border thickness of the annotation.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat thickness;

    Swift

    var thickness: CGFloat { get set }
  • The opacity of the annotation.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat opacity;

    Swift

    var opacity: CGFloat { get set }
  • The stroke style of the annotation.

    Declaration

    Objective-C

    @property (nonatomic) PTStrokeStyle strokeStyle;

    Swift

    var strokeStyle: PTAnnotStyle.StrokeStyle { get set }
  • The border effect of the annotation.

    Declaration

    Objective-C

    @property (nonatomic) PTBorderEffect borderEffect;

    Swift

    var borderEffect: PTBorderEffect { get set }
  • The border effect intensity of the annotation.

    Declaration

    Objective-C

    @property (nonatomic) double borderEffectIntensity;

    Swift

    var borderEffectIntensity: Double { get set }
  • The text size of a free text annotation.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat textSize;

    Swift

    var textSize: CGFloat { get set }
  • The font descriptor to use to choose the free text font.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull fontName;

    Swift

    var fontName: String { get set }
  • The horizontal alignment of a free text annotation.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger horizontalAlignment;

    Swift

    var horizontalAlignment: Int { get set }
  • The vertical alignment of a free text annotation.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger verticalAlignment;

    Swift

    var verticalAlignment: Int { get set }
  • The label applied to the annotation.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *label;

    Swift

    var label: String? { get set }
  • The date format applied to the date text.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull dateFormat;

    Swift

    var dateFormat: String { get set }
  • The date of the date text.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSDate *_Nonnull date;

    Swift

    var date: Date { get set }
  • The measurement scale for a measurement annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) PTMeasurementScale *measurementScale;

    Swift

    var measurementScale: PTMeasurementScale? { get set }
  • The line start style.

    Declaration

    Objective-C

    @property (nonatomic) PTEndingStyle lineStartStyle;

    Swift

    var lineStartStyle: PTEndingStyle { get set }
  • The line end style.

    Declaration

    Objective-C

    @property (nonatomic) PTEndingStyle lineEndStyle;

    Swift

    var lineEndStyle: PTEndingStyle { get set }
  • The line end styles.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSArray<NSNumber *> *_Nonnull lineEndStyles;

    Swift

    var lineEndStyles: [NSNumber] { get set }
  • Whether measurement tool snapping is enabled.

    Declaration

    Objective-C

    @property (nonatomic) BOOL snappingEnabled;

    Swift

    var snappingEnabled: Bool { get set }
  • Whether saveChanges also saves the current style properties as the defaults for the annotation type.

    The default valus is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL saveValuesAsDefaults;

    Swift

    var saveValuesAsDefaults: Bool { get set }
  • A calculated convenience string used for displaying the current thickness.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull thicknessIndicatorString;

    Swift

    var thicknessIndicatorString: String { get }
  • A calculated convenience string used for displaying the current opacity.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull opacityIndicatorString;

    Swift

    var opacityIndicatorString: String { get }
  • A calculated convenience string used for displaying the current text size.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull textSizeIndicatorString;

    Swift

    var textSizeIndicatorString: String { get }
  • Configure text field’s available style keys to edit text’s style.

    Declaration

    Objective-C

    - (void)configureTextField:(BOOL)textOnly;

    Swift

    func configureTextField(_ textOnly: Bool)
  • Save the current style properties back to the annotation.

    Declaration

    Objective-C

    - (void)saveChanges;

    Swift

    func saveChanges()
  • Apply the current style properties to the given annotation.

    Declaration

    Objective-C

    - (void)applyToAnnotation:(nonnull PTAnnot *)annotation;

    Swift

    func apply(toAnnotation annotation: PTAnnot)
  • Apply the current style properties to the given annotation and document.

    Declaration

    Objective-C

    - (void)applyToAnnotation:(nonnull PTAnnot *)annotation
                          doc:(nullable PTPDFDoc *)doc;

    Swift

    func apply(toAnnotation annotation: PTAnnot, doc: PTPDFDoc?)
  • Set the current style properties as the defaults for the annotation type.

    Declaration

    Objective-C

    - (void)setCurrentValuesAsDefaults;

    Swift

    func setCurrentValuesAsDefaults()
  • An object that conforms to the AnnotStyleDelegate protocol.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<PTAnnotStyleDelegate> delegate;

    Swift

    weak var delegate: (any PTAnnotStyleDelegate)? { get set }
  • When instantiated via initWithCoder, if any properties were not encoded, they will be listed here.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSArray<NSString *> *uninitializedProperties;

    Swift

    var uninitializedProperties: [String]? { get }
  • Compares the receiving annotation style instance to another instance.

    Declaration

    Objective-C

    - (BOOL)isEqualToAnnotStyle:(nonnull PTAnnotStyle *)annotStyle;

    Swift

    func isEqual(to annotStyle: PTAnnotStyle) -> Bool

    Parameters

    annotStyle

    an other annotation style instance

    Return Value

    YES if the annotation style instance is equal to the receiving instance, otherwise NO

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;