cete.dynamicpdf.pageelements.formattedtextareastyle
FormattedTextAreaStyle
- Namespace: ceTe.DynamicPDF.PageElements
- Assemblies: DynamicPDF.CoreSuite.dll
Represents an formatted text area style.
public class FormattedTextAreaStyle
Public Class FormattedTextAreaStyle
Inheritance: Object → FormattedTextAreaStyle
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
The following example shows a paragraph of formatted formatted text being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Create an formatted style
Dim style As FormattedTextAreaStyle = New FormattedTextAreaStyle(FontFamily.Helvetica, 12, False)
' Create the text and the formatted text area
Dim formattedText As String = "<p>Formatted text area provide rich formatting support for " + _
"text that appears in the document. You have complete control over 8 paragraph " + _
"properties: spacing before, spacing after, first line indentation, left indentation," + _
" right indentation, alignment, allowing orphan lines, and white space preservation; " + _
"6 font properties: <font face='Times'>font face, </font><font " + _
"pointSize='6'>font size, </font><font color='FF0000'>color, " + _
"</font><b>bold, </b><i<italic and </i><u>" + _
"underline</u>; and 2 line properties: leading, and leading type. Text can " + _
"also be rotated.</p>"
Dim MyFormattedTextArea As FormattedTextArea = New FormattedTextArea(formattedText, 0, 0, 256, 400, style)
' Add the formatted text area to the page
MyPage.Elements.Add(MyFormattedTextArea)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add( page );
// Create an formatted style
FormattedTextAreaStyle style = new FormattedTextAreaStyle( FontFamily.Helvetica, 12, false );
// Create the text and the formatted text area
string formattedText = "<p>Formatted text area provide rich formatting support for text that " + "appears in the document. You have complete control over 8 paragraph properties: " + "spacing before, spacing after, first line indentation, left indentation, right " + "indentation, alignment, allowing orphan lines, and white space preservation; 6 " + "font properties: <font face='Times'>font face, </font><font " + "pointSize='6'>font size, </font><font color='FF0000'>color, " + "</font><b>bold, </b><i>italic and </i><u>" + "underline</u>; and 2 line properties: leading, and leading type. Text can " + "also be rotated.</p>";
FormattedTextArea formattedTextArea = new FormattedTextArea( formattedText, 0, 0, 256, 400, style );
// Add the formatted text area to the page
page.Elements.Add( formattedTextArea );
// Save the PDF
document.Draw( outputPath );
}
}
Remarks
This class can be used to define a certain style of text to be used with an FormattedTextArea .
Constructors
FormattedTextAreaStyle(FontFamily, Single, Boolean)
Initializes a new instance of the FormattedTextAreaStyle structure.
public FormattedTextAreaStyle(FontFamily fontFamily, float fontSize, bool preserveWhiteSpace)
Public Sub New (fontFamily As FontFamily, fontSize As Single, preserveWhiteSpace As Boolean)
Parameters
- fontFamily: FontFamily
Font family of the style.
- fontSize: Single
Font size of the style.
- preserveWhiteSpace: Boolean
Preserve whitespace property of the style.
Licensing Info
This constructor 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.
Methods
Equals(Object)
Tests equality of styles.
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
Object to compare to the current FormattedTextAreaStyle .
Returns
true if the two styles are equal
Licensing Info
This method 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.
GetFont()
Returns the Font to use from the FontFamily of the style.
public Font GetFont()
Function GetFont() As Font
Returns
The Font of the style
Licensing Info
This method 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.
GetHashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current FormattedTextAreaStyle object.
Licensing Info
This method 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.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method 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.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method 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.
Fields
FormattedTextAreaStyle.Bold
Represents bold text.
FormattedTextAreaStyle.Font
Represents the font style.
FormattedTextAreaStyle.Italic
Represents italic text.
FormattedTextAreaStyle.Line
Represents the line style.
FormattedTextAreaStyle.Paragraph
Represents the paragraph style.
FormattedTextAreaStyle.TextRise
Represents the rise level for superscript ot subscript.
FormattedTextAreaStyle.Underline
Represents underlined text.