Class Ink

This class represents an Ink annotation.

Inheritance
System.Object
Ink
Implements
Namespace: PSPDFKit.Pdf.Annotation
Assembly: PSPDFKit.dll
Syntax
public sealed class Ink : object, IAnnotation

Properties

AnnotationType

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

BackgroundColor

Optional background Windows.UI.Color that will fill the complete bounding box.

Declaration
public Color? BackgroundColor { get; set; }
Property Value
Type Description
System.Nullable<Windows.UI.Color>

BlendMode

The blend mode to use when rendering.

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

BoundingBox

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

CreatedAt

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

CreatorName

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

CustomData

Declaration
public JsonObject CustomData { get; set; }
Property Value
Type Description
Windows.Data.Json.JsonObject

Id

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

IsDrawnNaturally

This value will currently not effect rendering on PSPDFKit for UWP.

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

IsSignature

Indicates whether the ink annotation is a signature.

Declaration
public bool? IsSignature { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

Lines

A list of line segments. Every segment consists again of a list of points with additional intensity information. The two nested lists are required since one ink annotation can consist of multiple lines. Within one segment, points will be connected using lines or curves. DrawingPoint for an additional intensity value (usually the pressure of a pointer device) that is used to reconstruct the naturally drawn image. If a device without intensity is used, the default intensity of 0.5 will be used. If no lines are present, the annotation will not be visible.

Declaration
public IList<IList<DrawingPoint>> Lines { get; set; }
Property Value
Type Description
IList<IList<DrawingPoint>>

LineWidth

The width of the lines in page size pixels. By default, we use values between 1 and 40 in the UI. The line width will scale when you zoom in.

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

Name

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

NoPrint

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

NoView

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

Opacity

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

PageIndex

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

PdfObjectId

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

StrokeColor

The Windows.UI.Color of the line.

Declaration
public Color? StrokeColor { get; set; }
Property Value
Type Description
System.Nullable<Windows.UI.Color>

UpdatedAt

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

Version

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

Methods

FromJson(JsonObject)

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.

FromPartialJson(JsonObject)

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.

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.

SetBoundingBoxAndResizeLines(Rect, Boolean)

Set the bounding box of the ink annotation and scale the lines and line width to new width and height.

Declaration
public void SetBoundingBoxAndResizeLines(Rect newBoundingBox, bool maintainAspectRatio)
Parameters
Type Name Description
Windows.Foundation.Rect newBoundingBox

New bounding box to set.

System.Boolean maintainAspectRatio

If true, scales the new bounding box to fit in the same aspect ratio of the current bounding box. Otherwise the signature will be stretched to fit the new bounding box.

ToJson()

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

Implements

IAnnotation

See Also