Class Text
This class represents a Text annotation.
Implements
Inherited Members
Namespace: PSPDFKit.Sdk.Models.Annotation
Assembly: Sdk.dll
Syntax
public sealed class Text : AnnotationBase, IAnnotation
Properties
| Edit this page View SourceBackgroundColor
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? |
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? |
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? |
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 |
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 |
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 |
ContentFormat
Format of content.
Declaration
[JsonIgnore]
public TextFormat ContentFormat { get; set; }
Property Value
Type | Description |
---|---|
TextFormat |
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 |
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 |
ForegroundColor
A Color for the visible glyphs.
Declaration
[JsonProperty("fontColor")]
[JsonConverter(typeof(ColorJsonConverter))]
public Color ForegroundColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
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 |
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 |
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 |
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 |
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 |
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 SourceToJson()
Declaration
public override string ToJson()
Returns
Type | Description |
---|---|
string |