Class AnnotationBase

Implements
Namespace: PSPDFKit.Sdk.Models.Annotation
Assembly: Sdk.dll
Syntax
public abstract class AnnotationBase : IAnnotation

Properties

| Edit this page View Source

BlendMode

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
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
[JsonConverter(typeof(BlendModeJsonConverter))]
public BlendMode BlendMode { get; set; }
Property Value
Type Description
BlendMode
| Edit this page View Source

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
[JsonProperty("bbox", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(RectangleJsonConverter))]
public IRectangle BoundingBox { get; set; }
Property Value
Type Description
IRectangle
| Edit this page View Source

CreatedAt

Gets or sets the date of the annotation creation.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public DateTimeOffset CreatedAt { get; }
Property Value
Type Description
DateTimeOffset
| Edit this page View Source

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
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
public string CreatorName { get; set; }
Property Value
Type Description
string
| Edit this page View Source

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
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
public JObject CustomData { get; set; }
Property Value
Type Description
JObject
| Edit this page View Source

Id

Gets the unique identifier to describe the annotation.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
public string Id { get; protected set; }
Property Value
Type Description
string
| Edit this page View Source

IsContentLocked

Gets or sets if the annotation content can be modified. Default value is false.

Declaration
[JsonIgnore]
public bool IsContentLocked { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsLocked

Gets or sets if the annotation can be modified. Default value is false.

Declaration
[JsonIgnore]
public bool IsLocked { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

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
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
Property Value
Type Description
string
| Edit this page View Source

Opacity

Gets or sets the opacity of the annotation, 0.0 - 1.0. Default value is 1.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public float Opacity { get; set; }
Property Value
Type Description
float
| Edit this page View Source

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
[JsonProperty("pdfObjectId", NullValueHandling = NullValueHandling.Ignore)]
public int? PDFObjectId { get; set; }
Property Value
Type Description
int?
| Edit this page View Source

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
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
public int PageIndex { get; set; }
Property Value
Type Description
int
| Edit this page View Source

ShouldPrint

Gets or sets if the annotation should be printed.

Declaration
[JsonIgnore]
public bool ShouldPrint { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

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
[JsonIgnore]
public bool ShouldRender { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

UpdatedAt

Gets the date of last annotation update.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public DateTimeOffset UpdatedAt { get; }
Property Value
Type Description
DateTimeOffset
| Edit this page View Source

Version

The Instant JSON spec version this annotation is compliant to.

Declaration
[JsonProperty("v")]
public int Version { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

ToJson()

Declaration
public virtual string ToJson()
Returns
Type Description
string
| Edit this page View Source

ToJson(ref JObject)

Declaration
protected virtual void ToJson(ref JObject jObj)
Parameters
Type Name Description
JObject jObj

Events

| Edit this page View Source

Deselected

This event will fire whenever the annotation is being deselected.

Declaration
public event Action Deselected
Event Type
Type Description
Action
| Edit this page View Source

Focused

This event will be emitted whenever the annotation is focused.

Declaration
public event Action Focused
Event Type
Type Description
Action
| Edit this page View Source

Pressed

The event will be emitted whenever the annotation is pressed.

Declaration
public event IAnnotation.PressedEventHandler Pressed
Event Type
Type Description
IAnnotation.PressedEventHandler
| Edit this page View Source

Selected

This event will fire whenever the annotation is being selected.

Declaration
public event Action Selected
Event Type
Type Description
Action
| Edit this page View Source

Unfocused

This event will be emitted whenever the annotation loses focus.

Declaration
public event Action Unfocused
Event Type
Type Description
Action

Implements

IAnnotation