Class Text

This class represents a Text annotation.

Inheritance
Text
Implements
Namespace: PSPDFKit.Sdk.Models.Annotation
Assembly: Sdk.dll
Syntax
public sealed class Text : AnnotationBase, IAnnotation

Properties

| Edit this page View Source

BackgroundColor

Optional background Color that will fill the complete bounding box.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(ColorJsonConverter))]
public Color? BackgroundColor { get; set; }
Property Value
Type Description
Color?
| Edit this page View Source

BorderColor

Optional border color that will be drawn at the border of the bounding box.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(ColorJsonConverter))]
public Color? BorderColor { get; set; }
Property Value
Type Description
Color?
| Edit this page View Source

BorderStyle

Gets or sets border style.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy), NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter), new object[] { typeof(CamelCaseNamingStrategy) })]
public BorderStyle? BorderStyle { get; set; }
Property Value
Type Description
BorderStyle?
| Edit this page View Source

BorderWidth

Gets or sets border width in PDF pixels, that will be used for the border of the bounding box.

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

Callout

Gets or sets callout for text annotation.

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

Content

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

ContentFormat

Format of content.

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

FontFamily

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

Declaration
[JsonProperty("font")]
public string FontFamily { get; set; }
Property Value
Type Description
string
| Edit this page View Source

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

ForegroundColor

A Color for the visible glyphs.

Declaration
[JsonProperty("fontColor")]
[JsonConverter(typeof(ColorJsonConverter))]
public Color ForegroundColor { get; set; }
Property Value
Type Description
Color
| Edit this page View Source

HorizontalAlign

The horizontal alignment of the text inside the bounding box.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
[JsonConverter(typeof(StringEnumConverter), new object[] { typeof(CamelCaseNamingStrategy) })]
public HorizontalAlign HorizontalAlign { get; set; }
Property Value
Type Description
HorizontalAlign
| Edit this page View Source

IsBold

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

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

IsFitting

When the annotation is modified through PSPDFKit for MAUI, we will set this flag whenever the whole text fits the bounds of the annotation without overflowing.

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

IsItalic

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

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

Rotation

The rotation of the annotation. Can either be 0°, 90°, 180°, or 270°.

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

VerticalAlign

The vertical alignment of the text inside the bounding box.

Declaration
[JsonProperty(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
[JsonConverter(typeof(StringEnumConverter), new object[] { typeof(CamelCaseNamingStrategy) })]
public VerticalAlign VerticalAlign { get; set; }
Property Value
Type Description
VerticalAlign

Methods

| Edit this page View Source

ToJson()

Declaration
public override string ToJson()
Returns
Type Description
string
Overrides
AnnotationBase.ToJson()

Implements

IAnnotation