Class Text

This class represents a Text annotation.

Inheritance
System.Object
Text
Implements
Namespace: PSPDFKit.Pdf.Annotation
Assembly: PSPDFKit.dll
Syntax
public sealed class Text : 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>

Bold

If true, the font will be bold if the font family supports this.

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

BoundingBox

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

Contents

The visible contents in plain text formats. We use a simple newline delimiter \n for multi line texts. A trailing newline (e.g. 'foobar\n' ) will result in an additional line. We don't support rich text formatting in the text field.

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

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

FontColor

A Windows.UI.Color for the visible glyphs.

Declaration
public Color FontColor { get; set; }
Property Value
Type Description
Windows.UI.Color

FontFamily

The name of the font family that should be used. The default is 'Helvetica'.

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

FontSize

The font size in page size pixels. Per default, we use values between 10 and 192 inclusive in the UI. The text will scale when you zoom in.

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

HorizontalAlign

The horizontal alignment of the text inside the bounding box.

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

Id

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

Italic

If true, the font will be italic if the font family supports this

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

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>

Rotation

The rotation of the annotation.

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

UpdatedAt

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

Version

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

VerticalAlign

The vertical alignment of the text inside the bounding box.

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

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.

ToJson()

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

Implements

IAnnotation

See Also