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 *)imageParameters
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)typeParameters
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)shapeParameters
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 |
|
shape |
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 *)colorParameters
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 standardTypeDiscussion
Gets the standard stamp type.
Declared In
CPDFStampAnnotation.h
– stampType
Returns the type of this stamp annotation.
- (CPDFStampType)stampTypeReturn 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 *)stampImageReturn 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 *textDiscussion
Gets the main text 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)rotationDiscussion
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)saveSourceRectDiscussion
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*> *)saveRectRotationPointsDiscussion
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