Class Widget
Widget annotations are part of PDF forms and used to position form elements, linked to IFormField, on a page. How a widget is rendered depends on the linked form field. Widget annotations are currently read only.
Inheritance
Implements
Namespace: PSPDFKit.Pdf.Annotation
Assembly: PSPDFKit.dll
Syntax
public sealed class Widget : IAnnotation
Properties
AnnotationType
The type of the annotation.
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 |
|---|---|
| BlendMode |
BorderStyle
Optional border style used for rendering the border of the bounding box.
Declaration
public BorderStyle? BorderStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<BorderStyle> |
BorderWidth
Optional border width in PDF pixels, that will be used for the border of the bounding box.
Declaration
public float? BorderWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Single> |
BoundingBox
The bounding box of the annotation within the page.
Declaration
public Rect BoundingBox { get; set; }
Property Value
| Type | Description |
|---|---|
| Windows.Foundation.Rect |
CreatedAt
The date of the annotation creation.
Declaration
public DateTimeOffset CreatedAt { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTimeOffset |
CreatorName
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 |
CustomData
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 |
FontColor
An optional color for the font.
Declaration
public Color? FontColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<Windows.UI.Color> |
FormFieldName
The Name of the linked form field. Based on the type of the field a different element will be rendered.
Declaration
public string FormFieldName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Id
A unique identifier to describe the annotation.
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Name
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 |
NoPrint
If the annotation should be printed or not.
Declaration
public bool NoPrint { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
NoView
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 |
Opacity
The opacity of the annotation, 0.0 - 1.0.
Declaration
public float Opacity { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
OptionalNote
An optional note. An note that can be set on any annotation. This value is displayed in the PSPDFKit for UWP UI for all annotations except note annotation, text annotation, and widget annotation.
Declaration
public string OptionalNote { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PageIndex
The page index of the annotation in the document.
Declaration
public int PageIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
PdfObjectId
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> |
UpdatedAt
The date of last annotation update.
Declaration
public DateTimeOffset UpdatedAt { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTimeOffset |
Version
The Instant JSON spec version this annotation is compliant to.
Declaration
public int Version { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
ToJson()
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. |