CPDFStampAnnotation Class Reference

Inherits from CPDFAnnotation : NSObject
Declared in CPDFStampAnnotation.h

Overview

A CPDFStampAnnotation object allows you to display a word or phrase in a PDF page.

A CPDFStampAnnotation object should have an appearance stream associated with it; otherwise, nothing useful is rendered.

Other Methods

– initWithPage:document:image:

Creates a stamp annotation with an image.

- (nullable instancetype)initWithPage:(CPDFPage *)page document:(CPDFDocument *)document image:(CPDFKitPlatformImage *)image

Parameters

page

The page on which the annotation will reside.

document

The document that owns the page.

image

The image to use as the stamp content.

Discussion

Creates a stamp annotation with an image.

Declared In

CPDFStampAnnotation.h

– initWithPage:document:standardType:

Creates a stamp annotation with a standard (predefined) stamp type.

- (nullable instancetype)initWithPage:(CPDFPage *)page document:(CPDFDocument *)document standardType:(NSInteger)type

Parameters

page

The page on which the annotation will reside.

document

The document that owns the page.

type

An integer value identifying the standard stamp (1–21).

Discussion

Creates a stamp annotation with a standard (predefined) stamp type.

Declared In

CPDFStampAnnotation.h

– initWithPage:document:text:detailText:style:shape:

Creates a stamp annotation with custom text.

- (nullable instancetype)initWithPage:(CPDFPage *)page document:(CPDFDocument *)document text:(NSString *)text detailText:(NSString *)detailText style:(CPDFStampStyle)style shape:(CPDFStampShape)shape

Parameters

page

The page on which the annotation will reside.

document

The document that owns the page.

text

The primary text content.

detailText

The secondary detail text.

style

The color style of the text stamp.

shape

The shape of the text stamp border.

Discussion

Creates a stamp annotation with custom text.

Declared In

CPDFStampAnnotation.h

– initWithPage:document:text:detailText:dateText:color:

Creates a stamp annotation with a digital stamp.

- (nullable instancetype)initWithPage:(CPDFPage *)page document:(CPDFDocument *)document text:(NSString *)text detailText:(NSString *)detailText dateText:(NSString *)dateText color:(CPDFKitPlatformColor *)color

Parameters

page

The page on which the annotation will reside.

document

The document that owns the page.

text

The primary text content.

detailText

The secondary detail text.

dateText

The date string displayed on the stamp.

color

The color used to render the digital stamp.

Discussion

Creates a stamp annotation with a digital stamp.

Declared In

CPDFStampAnnotation.h

  standardType

Gets the standard stamp type.

@property (nonatomic, assign, readonly) NSInteger standardType

Discussion

Gets the standard stamp type.

Declared In

CPDFStampAnnotation.h

– stampType

Returns the type of this stamp annotation.

- (CPDFStampType)stampType

Return Value

A @c CPDFStampType value indicating whether this is a standard, text, image, or digital stamp. Gets the stamp type.

Discussion

Returns the type of this stamp annotation.

See Also

Declared In

CPDFStampAnnotation.h

– stampImage

Returns the rendered image of the stamp annotation’s appearance stream.

- (CPDFKitPlatformImage *)stampImage

Return Value

The stamp appearance as a platform image, or @c nil if rendering fails.

Discussion

Returns the rendered image of the stamp annotation’s appearance stream.

If the appearance has not been generated yet, this method triggers rendering at the current screen scale.

Declared In

CPDFStampAnnotation.h

  text

Gets the main text of a text stamp annotation.

@property (nonatomic, copy, readonly, nullable) NSString *text

Discussion

Gets the main text of a text stamp annotation.

Only applies when stampType is CPDFStampTypeText.

Declared In

CPDFStampAnnotation.h

  detailText

Gets the detail text of a text stamp annotation.

@property (nonatomic, copy, readonly, nullable) NSString *detailText

Discussion

Gets the detail text of a text stamp annotation.

Only applies when stampType is CPDFStampTypeText.

Declared In

CPDFStampAnnotation.h

  style

Gets the style of a text stamp annotation.

@property (nonatomic, assign, readonly) CPDFStampStyle style

Discussion

Gets the style of a text stamp annotation.

Only applies when stampType is CPDFStampTypeText.

Declared In

CPDFStampAnnotation.h

  shape

Gets the shape of a text stamp annotation.

@property (nonatomic, assign, readonly) CPDFStampShape shape

Discussion

Gets the shape of a text stamp annotation.

Only applies when stampType is CPDFStampTypeText.

Declared In

CPDFStampAnnotation.h

Deprecated Methods

– setAnnotationRotation:

Deprecated. Use updateAnnotationRotation: to rotate stamp annotations.

- (void)setAnnotationRotation:(NSInteger)rotation

Discussion

Deprecated. Use updateAnnotationRotation: to rotate stamp annotations.

Swift: use updateRotation(…).

Declared In

CPDFStampAnnotation.h

– setSaveSourceRect:

Deprecated. Do not set the saved source rect directly.

- (void)setSaveSourceRect:(CGRect)saveSourceRect

Discussion

Deprecated. Do not set the saved source rect directly.

Use updateAnnotationRotation: for rotation, moveAnnotationWithActivePage:offset: for moving, and dragAnnotationWithCurrentPagePoint:draggedIndex: for resizing. Swift: use updateRotation(…), move(withActivePage:offset:), and drag(withCurrentPagePoint:draggedIndex:).

Declared In

CPDFStampAnnotation.h

– setSaveRectRotationPoints:

Deprecated. Do not set the saved rotation points directly.

- (void)setSaveRectRotationPoints:(NSArray<NSValue*> *)saveRectRotationPoints

Discussion

Deprecated. Do not set the saved rotation points directly.

Use updateAnnotationRotation: for rotation, moveAnnotationWithActivePage:offset: for moving, and dragAnnotationWithCurrentPagePoint:draggedIndex: for resizing. Swift: use updateRotation(…), move(withActivePage:offset:), and drag(withCurrentPagePoint:draggedIndex:).

Declared In

CPDFStampAnnotation.h