RichTextField
Represents the rich text field of a interactive forms.
public class RichTextField : TextField, ISerializable
Public Class RichTextField
Inherits TextField
Implements ISerializable
Inheritance: ObjectPageElementTaggablePageElementFormElementTextFieldRichTextField
Implements: ISerializable
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create an Rich Text Field and Add it to the page.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.Text
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a PDF Page
Dim MyPage As Page = New Page(PageSize.Letter)
Dim Xml As String = System.IO.File.ReadAllText(textPath)
' Create an Rich Text Field
Dim MyRichTextField As RichTextField = New RichTextField("txt", 50, 75, 150, 100)
' Add the Rich Text Field to the page
MyPage.Elements.Add(MyRichTextField)
' Add page to the document
MyDocument.Pages.Add(MyPage)
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.Text;
public class Example
{
public static void CreatePDF(string outputPath, string textPath)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page(PageSize.Letter);
string xml = System.IO.File.ReadAllText(textPath);
// Create an Rich Text Field
RichTextField textField = new RichTextField("rtxt", 0, 0, 300, 300, xml);
// Add the Rich Text Field to the page
page.Elements.Add(textField);
// Add page to the document
document.Pages.Add(page);
// Save the PDF document
document.Draw(outputPath);
}
}
Constructors
RichTextField(String, Single, Single, Single, Single, String) | Creates a new instance of RichTextField class. |
Properties
BackgroundColor | Gets or Sets the fill/background color of a form field. (Inherited from FormElement) |
BorderColor | Gets or Sets the border color of a form field. (Inherited from FormElement) |
BorderStyle | Gets or Sets the BorderStyle . (Inherited from FormElement) |
Comb | Gets or Sets the text field to be comb. (Inherited from TextField) |
DefaultValue | Gets or Sets the text field's default value. (Inherited from TextField) |
Font | Gets or Sets the font for the field. (Inherited from TextField) |
FontSize | Gets or Sets the font size for the field. (Inherited from TextField) |
Height | Gets or Sets the height of a form field. (Inherited from FormElement) |
ID | Gets or sets the ID of the page element. (Inherited from PageElement) |
IgnoreMargins | Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement) |
MappingName | Gets or Sets an mapping name, of a form field. (Inherited from FormElement) |
MaxLength | Gets or Sets the maximum length of characters in a text field. (Inherited from TextField) |
MultiLine | Gets or Sets the text field to contain multiple lines.
If set, the field may contain multiple lines of text;
if clear, the field?s text is restricted to a single line. (Inherited from TextField) |
Name | Gets or Sets the name of a form field. (Inherited from FormElement) |
NoExport | Gets or Sets the export state for the field.
If set, the field will not be exported by a submit-form action. (Inherited from TextField) |
Output | Gets or sets output options for the field. (Inherited from FormElement) |
Password | Gets or Sets the text field intended for entering a secure password
that should not be echoed visibly to the screen. (Inherited from TextField) |
Printable | Gets or Sets the form field printable on Pdf. By default its true. (Inherited from FormElement) |
ReaderEvents | Gets the reader events of the annotation. (Inherited from FormElement) |
ReadOnly | Gets or Sets the read only property status of the form field. (Inherited from FormElement) |
RelativeTo | Gets and sets placement of the page element on the page. (Inherited from PageElement) |
Required | Gets or Sets the required state for the field.
If set, the field must have a value at the time
it is exported by a submit-form action. (Inherited from TextField) |
Rotate | Gets or Sets the angle of a form field.
Rotation angle should be multiple of 90, default is 0. (Inherited from FormElement) |
Tag | Gets or sets the structure element of the form element. (Inherited from FormElement) |
TagOrder | Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement) |
TextAlign | Sets the text align. (Inherited from TextField) |
TextColor | Gets or Sets the color of the text for the field. (Inherited from FormElement) |
ToolTip | Gets or Sets an alternate field name, of a form field. (Inherited from FormElement) |
Visible | Gets or Sets the form field visible on Pdf. By default its true. (Inherited from FormElement) |
Width | Gets or Sets the width of a form field. (Inherited from FormElement) |
X | Gets or Sets the X coordinate of a form field. (Inherited from FormElement) |
Y | Gets or Sets the Y coordinate of a form field. (Inherited from FormElement) |
Methods
Draw(PageWriter) | Draws the rich text field to the given PageWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |