PSPDFRotatable

@protocol PSPDFRotatable <NSObject>

Annotations that can be rotated conform to this protocol.

  • The counterclockwise angle of the annotation relative to the page, in degrees. The angle should be between 0 and 359. Defaults to 0.

    To set the rotation, use setRotation(_:, updateBoundingBox:).

    Declaration

    Objective-C

    @property (readonly, atomic) NSUInteger rotation;

    Swift

    var rotation: Int32 { get }
  • Sets the rotation property, optionally updating the boundingBox to preserve the content size.

    Note

    Free text annotations only support rotations of 0, 90, 180, and 270 and do not support updating the bounding box.

    Updating the boundingBox of the annotation will ensure it encloses the content while preserving the content size and center, without distorting the annotation.

    Not updating the boundingBox would in general distort the annotation, but in some cases it is required to get the correct results, such as during setup.

    Declaration

    Objective-C

    - (void)setRotation:(NSUInteger)rotation
        updateBoundingBox:(BOOL)shouldUpdateBoundingBoxToMaintainContentSize;

    Swift

    func setRotation(_ rotation: Any!, updateBoundingBox shouldUpdateBoundingBoxToMaintainContentSize: Any!)

    Parameters

    rotation

    The new value for the rotation property. This should be between 0 and 359.

    shouldUpdateBoundingBoxToMaintainContentSize

    If true the boundingBox will be updated to preserve the content size.