Skip to main content

SingleByteEncoder

Version: 8.0

cete.dynamicpdf.text.singlebyteencoder

SingleByteEncoder​

Base class from which single byte encoders are derived.

public abstract class SingleByteEncoder : Encoder
Public MustInherit Class SingleByteEncoder
Inherits Encoder

Inheritance: Object → Encoder → SingleByteEncoder

Licensing​

This class is a DynamicPDF Generator Community Edition feature.

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;

class MyClass
{
static void Main()
{
// 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, 200, 12, centralEuropeHelveticaFont, 12 ) );
// Save the PDF document
document.Draw( @"C:\MyDocument.pdf" );
}
}

Remarks​

See the Text Encodings topic for more details on this.

Properties​

IsBuiltInEncoding​

Gets a value specifying if the encoding is built-in to PDF.

public bool IsBuiltInEncoding { get; }
Public Property IsBuiltInEncoding As Boolean

Property Value​

Boolean

SpaceIs0x20​

Gets a value indicating if the encoder uses a single byte 0x20 value for spaces. (Inherited from Encoder)

public bool SpaceIs0x20 { get; }
Public Property SpaceIs0x20 As Boolean

Property Value​

Boolean

Methods​

Decode(Byte)​

Decodes a single character.

public char Decode(byte character)
Function Decode(character As Byte) As Char

Parameters​

The character to decode.

Returns​

The decoded character.

DrawEncoding(DocumentWriter)​

Draws the encoding to the given DocumentWriter object. (Inherited from Encoder)

public void DrawEncoding(DocumentWriter writer)
Sub DrawEncoding(writer As DocumentWriter)

Parameters​

DocumentWriter object to receive the encoding's output.

Encode(Char)​

Encodes a single character.

public byte Encode(char character)
Function Encode(character As Char) As Byte

Parameters​

Character to encode.

Returns​

The encoded character.

Encode(FontSubsetter, Char[], Int32, Int32, Boolean)​

Encodes the specified text.

public Byte[] Encode(FontSubsetter subsetter, Char[] text, int start, int length, bool rightToLeft)
Function Encode(subsetter As FontSubsetter, text As Char[], start As Integer, length As Integer, rightToLeft As Boolean) As Byte()

Parameters​

FontSubsetter to use while encoding the text.

Text array to use for the encoding.

Start index in the text array.

Length of text to encode.

Specifies if the text should be encoded right to left.

Returns​

The encoded text as a byte array.

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​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

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 .

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.

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 .

See Also​

ceTe.DynamicPDF.Text