Skip to main content

RtfConverter

Version: 3.0

cete.dynamicpdf.conversion.rtfconverter

RtfConverter​

Defines methods and properties for the RtfConverter.

public class RtfConverter
Public Class RtfConverter

Inheritance: Object → RtfConverter

Licensing Info​

This class is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use RtfConverter class.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' create new instance of RtfConversionOptions.
Dim conversionOptions As RtfConversionOptions = New RtfConversionOptions(True)

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf",conversionOptions)

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// create new instance of RtfConversionOptions.
RtfConversionOptions conversionOptions=new RtfConversionOptions(true);

// Create new instance of Converter by providing suitable parameters.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf",conversionOptions);

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

Constructors​

RtfConverter(Byte[], String)​

Creates an instance of the RtfConverter class.

public RtfConverter(Byte[] inputData, string inputFileName)
Public Sub New (inputData As Byte(), inputFileName As String)

Parameters​

rtf document content in byte array format

Name of the rtf document from which the data needs to be read

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use RtfConverter class with input byte array and inputFile path as parameters.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

'Read all file data to a byte array.
Dim inputData As Byte() = File.ReadAllBytes("C:\MyDocument.rtf")

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter(inputData,"MyDocument.rtf")

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Read all file data to a byte array.
byte [] inputData=File.ReadAllBytes("C:\MyDocument.rtf");

// Create new instance of Converter by providing suitable parameters.
RtfConverter rtf = new RtfConverter(inputData,"MyDocument.rtf");

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

RtfConverter(Byte[], String, RtfConversionOptions)​

Creates an instance of the RtfConverter class.

public RtfConverter(Byte[] inputData, string inputFileName, RtfConversionOptions conversionOptions)
Public Sub New (inputData As Byte(), inputFileName As String, conversionOptions As RtfConversionOptions)

Parameters​

rtf document content in byte array format

Name of the rtf document from which the data needs to be read

Initializes the ConversionOptions property of the class.

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use RtfConverter class with inputDataByte, inputFile path and conversionOptions as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()
' create new instance of RtfConversionOptions.
Dim conversionOptions As RtfConversionOptions = New RtfConversionOptions(True)

'Read all file data to a byte array.
Dim inputData As Byte() = File.ReadAllBytes("C:\MyDocument.rtf")

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter(inputData,"MyDocument.rtf",conversionOptions)

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{

// create new instance of RtfConversionOptions.
RtfConversionOptions conversionOptions=new RtfConversionOptions(true);

// create new instance of RtfConversionOptions.
byte [] inputData=File.ReadAllBytes("C:\MyDocument.rtf");

// Create new instance of Converter by providing suitable parameters.
RtfConverter rtf = new RtfConverter(inputData, "MyDocument.rtf",conversionOptions);

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

RtfConverter(String)​

Creates an instance of the RtfConverter class.

public RtfConverter(string inputFilePath)
Public Sub New (inputFilePath As String)

Parameters​

Path where the rtf document is located

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use RtfConverter with inputFilePath as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{

// Create new instance of Converter by providing suitable parameters.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

RtfConverter(String, RtfConversionOptions)​

Creates an instance of the RtfConverter class.

public RtfConverter(string inputFilePath, RtfConversionOptions conversionOptions)
Public Sub New (inputFilePath As String, conversionOptions As RtfConversionOptions)

Parameters​

Path to the rtf document from which the data needs to be read

Initializes the ConversionOptions property of the class.

Licensing Info​

This constructor is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use RtfConverter class with inputFile path and conversionOptions as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' create new instance of RtfConversionOptions.
Dim conversionOptions As RtfConversionOptions = New RtfConversionOptions(True)

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf",conversionOptions)

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// create new instance of RtfConversionOptions.
RtfConversionOptions conversionOptions=new RtfConversionOptions(true);

// Create new instance of Converter by providing suitable parameters.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf",conversionOptions);

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

Properties​

ConversionOptions​

Gets the instance of the RtfConversionOptions class

public RtfConversionOptions ConversionOptions { get; }
Public Property ConversionOptions As RtfConversionOptions

Property Value​

RtfConversionOptions

Licensing Info​

This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Methods​

Convert()​

Converts Rtf to Pdf

public Byte[] Convert()
Function Convert() As Byte()

Returns​

returns a output pdf byte array

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with output byte array as return type.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
Dim output As Byte() = rtfConversion.Convert()

If (output IsNot Nothing) Then
'save byte array output to a file.
File.WriteAllBytes("C:\MyOutputFile.pdf", output)
End If

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
byte []output=rtf.Convert();

if(output!=null)
{
//save byte array output to a file.
File.WriteAllBytes("C:\MyOutputFile.pdf",output);
}
}
}

Convert(Byte[])​

Converts Rtf to Pdf

public Byte[] Convert(Byte[] pdfToAppendTo)
Function Convert(pdfToAppendTo As Byte()) As Byte()

Parameters​

Contents of Pdf in byte array format, to which the current conversion needs to be appended to

Returns​

returns a output pdf byte array

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with pdf byte array as parameter and byte array as return type.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
Dim output As Byte() = rtfConversion.Convert()

If (output IsNot Nothing) Then
Dim finalOutput As Byte() = rtfConversion.Convert(output)
'save byte array output to a file.
File.WriteAllBytes("C:\MyOutputFile.pdf", finalOutput)
End If

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
byte []output=rtf.Convert();

if(output!=null)
{
byte []finalOutputByte=rtf.Convert(output);
//save byte array output to a file.
File.WriteAllBytes("C:\MyOutputFile.pdf",finalOutputByte);
}
}
}

Convert(String)​

Converts Rtf to Pdf

public void Convert(string outputFilePath)
Sub Convert(outputFilePath As String)

Parameters​

Path where the output file needs to be saved

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with outputFilePath as parameter.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
rtfConversion.Convert("C:\MyOutput.pdf")

End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static void Main()
{
// Create new instance of Converter.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
rtf.Convert(@"C:\MyOutput.pdf");
}
}

ConvertAsync()​

Does the Asynchronous conversion

public Task&ltByte[]> ConvertAsync()
Function ConvertAsync() As Task(Of Byte())

Returns​

returns a Task where the result type is byte array

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with byte array as return type.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Async Function run() As Task

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
Dim result= Await rtfConversion.ConvertAsync();
If (result IsNot Nothing) Then
File.WriteAllBytes("C:\MyDocument.pdf",result)
End If
End Function

Sub Main()
run().Wait()
End Sub

End Module
using ceTe.DynamicPDF.Conversion;
using System.IO;

class MyClass
{
static async Task run()
{

// Create new instance of Converter.
RtfConverter rtf= new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
byte[] result= await rtf.ConvertAsync();
if(result!=null)
{
File.WriteAllBytes("C:\MyDocumetn.pdf", result);

}
}
static void Main()
{
run().Wait();
}
}

ConvertAsync(Byte[])​

Does the Asynchronous conversion

public Task&ltByte[]> ConvertAsync(Byte[] pdfToAppendTo)
Function ConvertAsync(pdfToAppendTo As Byte()) As Task(Of Byte())

Parameters​

Contents of Pdf in byte array format, to which the current conversion needs to be appended to

Returns​

returns a Task where the result type is byte array

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with pdf byte array as parameter and byte array as return type.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Async Function run() As Task

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
Dim result= Await rtf.ConvertAsync()
If (result IsNot Nothing) Then
Dim finalResult =Await rtf.ConvertAsync(result)
If (finalResult IsNot Nothing) Then
File.WriteAllBytes("C:\MyDocument.pdf",finalResult)
End If
End If

End Function

Sub Main()
run().Wait()
End Sub

End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
static async Task run()
{

// Create new instance of Converter.
RtfConverter rtf = new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
byte [] result=await rtf.ConvertAsync();
if(result!=null)
{
byte[] finalResult=await rtf.ConvertAsync(result)
if(finalResult!=null)
File.WriteAllBytes("C:\MyDocumetn.pdf", finalResult);
}
}
static void Main()
{
run().Wait();
}
}

ConvertAsync(String)​

Does the Asynchronous conversion

public Task&ltbool> ConvertAsync(string outputFilePath)
Function ConvertAsync(outputFilePath As String) As Task(Of Boolean)

Parameters​

Returns​

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples​

This example shows how to use convert method with pdf byte array as return type.

Imports ceTe.DynamicPDF.Conversion

Module Module1

Async Function run() As Task

' Create new instance of Converter by providing suitable parameters.
Dim rtfConversion As RtfConverter = New RtfConverter("C:\MyDocument.rtf")

' Call Convert method to start conversion
Dim result= Await rtfConversion.ConvertAsync("C:\MyOutput.pdf")
If (result) Then
Console.WriteLine("Completed successfully);
End If

End Function

Sub Main()
run().Wait()
End Sub

End Module
using ceTe.DynamicPDF.Conversion;
using Syste.IO;

class MyClass
{
static async Task run()
{

// Create new instance of Converter.
RtfConverter rtf= new RtfConverter(@"C:\MyDocument.rtf");

//Call Convert method to start conversion
bool result=await rtf.ConvertAsync(@"C:\MyOutput.pdf");
if(result)
{
Console.WriteLine("Completed successfully);
}
}
static void Main()
{
run().Wait();
}
}

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.

Licensing Info​

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Events​

Completed​

Occurs when a document is successfully converted.

public event ConversionCompleted RtfConverter.Completed;
Public Event RtfConverter.Completed As ConversionCompleted

Event Handler​

ConversionCompleted

Licensing Info​

This event is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

ProgressChanged​

Occurs when the status of a document conversion changes.

public event ProgressChanged RtfConverter.ProgressChanged;
Public Event RtfConverter.ProgressChanged As ProgressChanged

Event Handler​

ProgressChanged

Licensing Info​

This event is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.Conversion