AsyncConverter [Obsolete]
Obsolete. Represents a asynchronised conversion.
public class AsyncConverter : Converter
Public Class AsyncConverter
Inherits Converter
Inheritance: ObjectConverterAsyncConverter
Licensing Info
This class is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
This example shows how to convert files to PDF asynchronously.Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' create an instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' Events to know if conversion completed successfully or not
AddHandler converter.Converted, AddressOf converter_Converted
AddHandler converter.ConversionError, AddressOf converter_ConversionError
' Call Convert method to start conversion asynchronously and Get the status of conversion
Dim asyncConversion As AsyncConversion = converter.Convert("C:\MyDocument.doc", "C:\MyOutput.pdf")
While (True)
If(asyncConversion.Aborted Or asyncConversion.Exception IsNot Nothing) Then
Exit While
ElseIf(asyncConversion.Completed) Then
Exit While
End If
End While
End Sub
Sub converter_Converted(ByVal sender As Object, ByVal e As ConvertedEventArgs)
Console.WriteLine(e.SourceFilePath + " was converted successfully.")
End Sub
Sub converter_ConversionError(ByVal sender As Object, ByVal e As ConversionErrorEventArgs)
Console.WriteLine(e.SourceFilePath + " conversion failed for the following reason:")
Console.WriteLine("\"" + e.Exception.Message + " \ "")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// create an instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// Events to know if conversion completed successfully or not
converter.Converted += new ConvertedEventHandler(converter_Converted);
converter.ConversionError += new ConversionErrorEventHandler(converter_ConversionError);
// Call Convert method to start conversion asynchronously and Get the status of conversion
AsyncConversion asyncConversion = converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf");
while(true)
{
if(asyncConversion.Aborted ||asyncConversion.Exception== null)
{
break;
}
else if (asyncConversion.Completed)
{
break;
}
}
}
private static void converter_Converted(object sender, ConvertedEventArgs e)
{
Console.WriteLine(e.SourceFilePath + " was converted successfully.");
}
private static void converter_ConversionError(object sender, ConversionErrorEventArgs e)
{
Console.WriteLine(e.SourceFilePath + " conversion failed for the following reason:");
Console.WriteLine("\"" + e.Exception.Message + "\"");
}
}
Remarks
NOTE: This Class is obsolete. Use ConvertAsync(System.String) property instead.
Constructors
AsyncConverter() | Initializes a new instance of AsyncConverter class. |
Methods
Convert(Byte[], String) | Converts the source byte array to a PDF and get the output PDF as byte array. |
Convert(Byte[], String, ConversionOptions, Byte[]) | Converts the source byte array to a PDF and get the output PDF as byte array. |
Convert(Byte[], String, String) | Converts the source byte array to a PDF of the given name. |
Convert(Byte[], String, String, ConversionOptions) | Converts the source byte array to a PDF of the given name. |
Convert(String) | Converts the source file to a PDF and get the output as byte array. |
Convert(String, ConversionOptions, Byte[]) | Converts the source file to a PDF and get the output PDF in byte array. |
Convert(String, String) | Converts the source file to a PDF of the given name. |
Convert(String, String, ConversionOptions) | Converts the source file to a PDF of the given name. |
ConvertHtmlString(String) | Converts the HTML string to a PDF and get the output PDF as byte array. |
ConvertHtmlString(String, HtmlConversionOptions) | Converts the HTML string to a PDF and get the output PDF as byte array. |
ConvertHtmlString(String, HtmlConversionOptions, Byte[]) | Converts the HTML string to a PDF and get the output PDF as byte array. |
ConvertHtmlString(String, String) | Converts the HTML string to a PDF of the given name. |
ConvertHtmlString(String, String, HtmlConversionOptions) | Converts the HTML string to a PDF of the given name. |
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) |
Events
AsyncConverter.ConversionError | Occurs when a conversion error occurs. (Inherited from Converter) |
AsyncConverter.Converted | Occurs when a document is successfully converted. (Inherited from Converter) |
AsyncConverter.ProgressChanged | Occurs when the status of a document conversion changes. (Inherited from Converter) |