cete.dynamicpdf.conversion.asyncconversion
AsyncConversion [Obsolete]
- Namespace: ceTe.DynamicPDF.Conversion
- Assemblies: DynamicPDF.Converter.dll
Obsolete. Represents an asynchronous conversion process.
public class AsyncConversion
Public Class AsyncConversion
Inheritance: Object → AsyncConversion
Licensing Info
This class is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription 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 asynchronously.
Imports System
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' create an instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' 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.Completed) Then
Dim MyData() As Byte = asyncConversion.GetOutputData()
Exit While
End If
End While
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// create an instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// 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.Completed)
{
byte[] MyData = asyncConversion.GetOutputData();
break;
}
}
}
}
Remarks
NOTE: This class is obsolete. Use ConvertAsync(System.String) method instead.
Properties
Aborted
Gets an indication whether the asynchronous operation has aborted.
public bool Aborted { get; }
Public Property Aborted As Boolean
Property Value
Licensing Info
This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription 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 make use of aborted property of AsyncConversion.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' create an instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' 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")
asyncConversion.Abort()
While(True)
If(asyncConversion.Aborted) Then
Console.WriteLine("File is aborted")
Exit While
Else If(asyncConverion.Completed) Then
Console.WriteLine("Conversion Completed")
Exit While
End IF
End While
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// create an instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// Call Convert method to start conversion asynchronously and Get the status of conversion
AsyncConversion asyncConversion = converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf");
asyncConversion.Abort();
while (true)
{
if (asyncConversion.Aborted)
{
Console.WriteLine("File is aborted");
break;
}
else if(asyncConverion.Completed)
{
Console.WriteLine("Conversion Completed");
break;
}
}
}
}
Completed
Gets an indication whether the asynchronous operation has completed.
public bool Completed { get; }
Public Property Completed As Boolean
Property Value
Licensing Info
This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription 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 make use of IsCompleted property of AsyncConversion.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create a instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' Call Convert method to start conversion asynchronously and Get the status of conversion
Dim asyncConversion As AsyncConversion = converter.Convert("C:\MyDocument.doc")
While (True)
If (asyncConversion.Completed) Then
Dim MyData() As Byte = asyncConversion.GetOutputData()
Exit While
End If
End While
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// Call Convert method to start conversion asynchronously and Get the status of conversion
AsyncConversion asyncConversion = converter.Convert(@"C:\MyDocument.doc");
while(true)
{
if (asyncConversion.Completed)
{
byte[] MyData = asyncConversion.GetOutputData();
break;
}
}
}
}
Exception
Gets the exception that occurred during the conversion operation.
public Exception Exception { get; }
Public Property Exception As Exception
Property Value
Licensing Info
This property is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
Examples
Example shows how to use Exception property of asyncConversion class.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' create an instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' 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")
asyncConversion.Abort()
While(True)
If (asyncConversion.Completed Or asyncConversion.Exception IsNot Nothing) Then
Console.WriteLine("Conversion completed or Exception occurred.")
Exit While
End IF
End While
End Sub
End Module
class MyClass
{
static void Main()
{
// create an instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// 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.Exception != null || asyncConversion.Completed)
{
Console.WriteLine("Conversion completed or exception occured");
break;
}
}
}
}
Methods
Abort()
Abort the asynchronous conversion request.
public void Abort()
Sub Abort()
Licensing Info
This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription 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 make use of aborted property of AsyncConversion.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' create an instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' 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")
asyncConversion.Abort()
While(True)
If(asyncConversion.Aborted) Then
Console.WriteLine("File is aborted")
End While
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// create an instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// Call Convert method to start conversion asynchronously and Get the status of conversion
AsyncConversion asyncConversion = converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf");
asyncConversion.Abort();
while (true)
{
if (asyncConversion.Aborted)
{
Console.WriteLine("File is aborted");
break;
}
}
}
}
Remarks
Call for abort immediately or after the conversion ends will throw an exception.
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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.
GetOutputData()
Returns the byte array of the converted pdf.
public Byte[] GetOutputData()
Function GetOutputData() As Byte()
Returns
Byte array of the converted PDF.
Licensing Info
This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription 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 make use of GetOutputData method of AsyncConversion.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create a instance of AsyncConverter
Dim converter As AsyncConverter = New AsyncConverter
' Call Convert method to start conversion asynchronously and Get the status of conversion
Dim asyncConversion As AsyncConversion = converter.Convert("C:\MyDocument.doc")
While (True)
If (asyncConversion.Completed) Then
Dim MyData() As Byte = asyncConversion.GetOutputData()
Exit While
End If
End While
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of AsyncConverter
AsyncConverter converter = new AsyncConverter();
// Call Convert method to start conversion asynchronously and Get the status of conversion
AsyncConversion asyncConversion = converter.Convert(@"C:\MyDocument.doc");
while(true)
{
if (asyncConversion.Completed)
{
byte[] MyData = asyncConversion.GetOutputData();
break;
}
}
}
}
Remarks
Should be used when call to convert method was made without output path parameter.
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.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 DynamicPDF Converter feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Converter selected.
- A DynamicPDF Converter for .NET v3.X Developer license.