Interface IAnnotation
Interface that represents an annotation.
Namespace: PSPDFKit.Api.Annotation
Assembly: Api.dll
Syntax
public interface IAnnotation
Properties
| Edit this page View SourceBlendMode
Gets or sets the blend mode for annotation. Blend mode defines how the color of the annotation will be applied to its background. Default value is Normal
Declaration
BlendMode BlendMode { get; set; }
Property Value
| Type | Description |
|---|---|
| BlendMode |
BoundingBox
Gets or sets the bounding box of the annotation within the page. It's necessary that this spans all visible points of the annotation, otherwise hit testing and other features may not work.
Declaration
IRectangle BoundingBox { get; set; }
Property Value
| Type | Description |
|---|---|
| IRectangle |
CreatedAt
Gets or sets the date of the annotation creation.
Declaration
DateTimeOffset CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
CreatorName
Gets or sets the name of the creator of the annotation. This is a general purpose string which can easily be spoofed and might not reflect the actual creator of the annotation.
Declaration
string CreatorName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
CustomData
Gets or sets additional user-specified data.
PSPDFKit does not use or evaluate CustomData in the UI directly.
You have full control over this property.
For a new annotation, this defaults to a null object.
Declaration
JObject CustomData { get; set; }
Property Value
| Type | Description |
|---|---|
| JObject |
Id
Gets the unique identifier to describe the annotation.
Declaration
string Id { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsContentLocked
Gets or sets if the annotation content can be modified. Default value is false.
Declaration
bool IsContentLocked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsLocked
Gets or sets if the annotation can be modified. Default value is false.
Declaration
bool IsLocked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Name
Gets or sets name for annotation. This is an optional field that may be used to identify the annotation. By default, it is set that to the same value as the automatically generated Id.
Declaration
string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Opacity
Gets or sets the opacity of the annotation, 0.0 - 1.0. Default value is 1.
Declaration
float Opacity { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
PDFObjectId
Gets or sets the identifier that was used in the PDF document. This ID is optional since newly created annotations won't have a PDFObjectId assigned.
Declaration
int? PDFObjectId { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
PageIndex
Gets or sets the page index of the annotation in the document.
It's important to notice that an annotation can only ever be on one page.
If you create for example an ink annotation with lines on two pages, two annotation records will be created.
It is a zero-based and has maximum value of totalPageCount - 1
Declaration
int PageIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ShouldPrint
Gets or sets if the annotation should be printed.
Declaration
bool ShouldPrint { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ShouldRender
Gets or sets if the annotation should be rendered in the UI. The annotation may still be part of the printed page, depending on the value of ShouldPrint
Declaration
bool ShouldRender { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UpdatedAt
Gets the date of last annotation update.
Declaration
DateTimeOffset UpdatedAt { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
Version
The Instant JSON spec version this annotation is compliant to.
Declaration
int Version { get; }
Property Value
| Type | Description |
|---|---|
| int |
Events
| Edit this page View SourceDeselected
This event will fire whenever the annotation is being deselected.
Declaration
event Action Deselected
Event Type
| Type | Description |
|---|---|
| Action |
Focused
This event will be emitted whenever the annotation is focused.
Declaration
event Action Focused
Event Type
| Type | Description |
|---|---|
| Action |
Pressed
The event will be emitted whenever the annotation is pressed.
Declaration
event IAnnotation.PressedEventHandler Pressed
Event Type
| Type | Description |
|---|---|
| IAnnotation.PressedEventHandler |
Selected
This event will fire whenever the annotation is being selected.
Declaration
event Action Selected
Event Type
| Type | Description |
|---|---|
| Action |
Unfocused
This event will be emitted whenever the annotation loses focus.
Declaration
event Action Unfocused
Event Type
| Type | Description |
|---|---|
| Action |