Class Link

This class represents a Link annotation.

Inheritance
System.Object
Link
Implements
Namespace: PSPDFKit.Pdf.Annotation
Assembly: PSPDFKit.dll
public sealed class Link : IAnnotation

Constructors

Constructs a Link with an IAction.

Declaration
public Link(IAction action)
Parameters
Type Name Description
IAction action

The IAction that will be triggered when the link annotation is either clicked or tapped.

Properties

The IAction that will be triggered when the link annotation is either clicked or tapped.

Declaration
public IAction Action { get; set; }
Property Value
Type Description
IAction

The type of the annotation.

Declaration
public AnnotationType AnnotationType { get; }
Property Value
Type Description
AnnotationType

The blend mode to use when rendering.

Declaration
public BlendMode BlendMode { get; set; }
Property Value
Type Description
BlendMode

The bounding box of the annotation within the page.

Declaration
public Rect BoundingBox { get; set; }
Property Value
Type Description
Windows.Foundation.Rect

The date of the annotation creation.

Declaration
public DateTimeOffset CreatedAt { get; set; }
Property Value
Type Description
System.DateTimeOffset

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
public string CreatorName { get; set; }
Property Value
Type Description
System.String

Annotations can store 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
public JsonObject CustomData { get; set; }
Property Value
Type Description
Windows.Data.Json.JsonObject

A unique identifier to describe the annotation.

Declaration
public string Id { get; set; }
Property Value
Type Description
System.String

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
public string Name { get; set; }
Property Value
Type Description
System.String

If the annotation should be printed or not.

Declaration
public bool NoPrint { get; set; }
Property Value
Type Description
System.Boolean

The property that determines if the annotation is prevented from being rendered in the UI. The annotation may still be rendered in a printed page, depending of the value of NoPrint.

Declaration
public bool NoView { get; set; }
Property Value
Type Description
System.Boolean

The opacity of the annotation, 0.0 - 1.0.

Declaration
public float Opacity { get; set; }
Property Value
Type Description
System.Single

The page index of the annotation in the document.

Declaration
public int PageIndex { get; set; }
Property Value
Type Description
System.Int32

The Pdf object ID, if the annotation is included in a Pdf file.

Declaration
public int? PdfObjectId { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The date of last annotation update.

Declaration
public DateTimeOffset UpdatedAt { get; set; }
Property Value
Type Description
System.DateTimeOffset

The Instant JSON spec version this annotation is compliant to.

Declaration
public int Version { get; }
Property Value
Type Description
System.Int32

Methods

Constructs the IAnnotation from the Instant JSON representing it. See https://pspdfkit.com/guides/server/current/document/json-format/ If any mandatory properties are missing then an exception will be thrown.

Declaration
public static IAnnotation FromJson(JsonObject json)
Parameters
Type Name Description
Windows.Data.Json.JsonObject json

The Instant JSON representing the IAnnotation.

Returns
Type Description
IAnnotation

The IAnnotation represented by the Instant JSON.

Constructs the IAnnotation from the Instant JSON representing it. See https://pspdfkit.com/guides/server/current/document/json-format/ This method does not require mandatory properties to be present in the JSON. Instead appropriate default values will be used. If no Action is specified a default GoTo page 0 action will be set.

Declaration
public static IAnnotation FromPartialJson(JsonObject json)
Parameters
Type Name Description
Windows.Data.Json.JsonObject json

The Instant JSON or partial Instant JSON representing the IAnnotation

Returns
Type Description
IAnnotation

The IAnnotation represented by the Instant JSON.

Converts the annotation to the Instant JSON annotation format. See https://pspdfkit.com/guides/server/current/document/json-format/

Declaration
public JsonObject ToJson()
Returns
Type Description
Windows.Data.Json.JsonObject

The annotation object.

Implements

IAnnotation

See Also