cete.dynamicpdf.text.encoder
Encoder
- Namespace: ceTe.DynamicPDF.Text
- Assemblies: DynamicPDF.CoreSuite.dll
Base class from which encoders are derived.
public abstract class Encoder
Public MustInherit Class Encoder
Inheritance: Object → Encoder
Derived: SingleByteEncoder
Licensing Info
This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
This example shows how to Change the encoding of a built in font.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Text
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 a core font with a specified encoding Dim MyCentralEuropeHelveticaFont As Font = New Helvetica(Encoder.CentralEurope) ' Use the font in a text area Page Element MyPage.Elements.Add(New TextArea("Text using the Central Europe encoder", 0, 0, 200, 12, MyCentralEuropeHelveticaFont, 12)) ' Save the PDF document MyDocument.Draw("C:\MyDocument.pdf") End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Text;
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 a core font with a specified encoding
Font centralEuropeHelveticaFont = new Helvetica(Encoder.CentralEurope);
// Use the font in a text area Page Element
page.Elements.Add(new TextArea("Text using the Central Europe encoder", 0, 0, 250, 12, centralEuropeHelveticaFont, 12));
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This class contains the static properties from which all encodings are accessed. See the Text Encodings topic for more details on this.
Properties
Baltic
Gets the Baltic encoder.
public static SingleByteEncoder Baltic { get; }
Public Shared Property Baltic As SingleByteEncoder
Property Value
Licensing Info
This property 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.
CentralEurope
Gets the central Europe encoder.
public static SingleByteEncoder CentralEurope { get; }
Public Shared Property CentralEurope As SingleByteEncoder
Property Value
Licensing Info
This property 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.
Latin1
Gets the Latin 1 encoder.
public static SingleByteEncoder Latin1 { get; }
Public Shared Property Latin1 As SingleByteEncoder
Property Value
Licensing Info
This property 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.
Latin2
Gets the Latin 2 (WINANSI) encoder.
public static SingleByteEncoder Latin2 { get; }
Public Shared Property Latin2 As SingleByteEncoder
Property Value
Licensing Info
This property 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.
Latin9
Gets the Latin 9 encoder.
public static SingleByteEncoder Latin9 { get; }
Public Shared Property Latin9 As SingleByteEncoder
Property Value
Licensing Info
This property 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.
SpaceIs0x20
Gets a value indicating if the encoder uses a single byte 0x20 value for spaces.
public bool SpaceIs0x20 { get; }
Public Property SpaceIs0x20 As Boolean
Property Value
Licensing Info
This property 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.
Turkish
Gets the Turkish encoder.
public static SingleByteEncoder Turkish { get; }
Public Shared Property Turkish As SingleByteEncoder
Property Value
Licensing Info
This property 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.
Unicode
Gets the Unicode encoder.
public static Encoder Unicode { get; }
Public Shared Property Unicode As Encoder
Property Value
Licensing Info
This property 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
DrawEncoding(DocumentWriter)
Draws the encoding to the given DocumentWriter object.
public void DrawEncoding(DocumentWriter writer)
Sub DrawEncoding(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
DocumentWriter object to receive the encoding's output.
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.
Encode(FontSubsetter, Char[], Int32, Int32, Boolean)
Encodes the specified text.
public abstract Byte[] Encode(FontSubsetter subsetter, Char[] text, int start, int length, bool rightToLeft)
MustOverride Function Encode(subsetter As FontSubsetter, text As Char[], start As Integer, length As Integer, rightToLeft As Boolean) As Byte()
Parameters
- subsetter: FontSubsetter
FontSubsetter to use while encoding the text.
- text: Char[]
Text array to use for the encoding.
- start: Int32
Start index in the text array.
- length: Int32
Length of text to encode.
- rightToLeft: Boolean
Specifies if the text should be encoded right to left.
Returns
The encoded text as a byte array.
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.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
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. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for 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.
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.