Converter.ConvertAsync

Overloads

ConvertAsync(Byte[], String)Performs Asynchronous conversion.
ConvertAsync(Byte[], String, ConversionOptions)Performs Asynchronous conversion.
ConvertAsync(Byte[], String, ConversionOptions, Byte[])Performs Asynchronous conversion.
ConvertAsync(Byte[], String, String)Performs Asynchronous conversion.
ConvertAsync(Byte[], String, String, ConversionOptions)Performs Asynchronous conversion.
ConvertAsync(String)Performs Asynchronous conversion.
ConvertAsync(String, ConversionOptions)Performs Asynchronous conversion.
ConvertAsync(String, ConversionOptions, Byte[])Performs Asynchronous conversion.
ConvertAsync(String, String)Performs Asynchronous conversion.
ConvertAsync(String, String, ConversionOptions)Performs Asynchronous conversion.

ConvertAsync(Byte[], String)

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(Byte[] inputData, string inputFileName)
Shared Function ConvertAsync(inputData As Byte(), inputFileName As String) As Task(Of Byte())

Parameters

inputData
Byte[]

Source byte array to be converted.

inputFileName
String

File name or extension of file which is stored as byte array.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
         Dim inputData() As Byte =File.ReadAllBytes(@"C:\MyDocument.doc");
            
        Dim result = Await Converter.ConvertAsync(inputData, ".doc")
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
        
        byte[] result= await Converter.ConvertAsync(inputData, ".doc")
        if(result!=null)
        {
                File.WriteAllBytes("C:/MyOutput.pdf",result);
            
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(Byte[], String, ConversionOptions)

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(Byte[] inputData, string inputFileName, ConversionOptions conversionOptions)
Shared Function ConvertAsync(inputData As Byte(), inputFileName As String, conversionOptions As ConversionOptions) As Task(Of Byte())

Parameters

inputData
Byte[]

Source byte array to be converted.

inputFileName
String

File name or extension of file which is stored as byte array.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
        
        Dim inputData() As Byte =File.ReadAllBytes("C:\MyDocument.doc")
        
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
             
        Dim result = Await Converter.ConvertAsync(inputData, ".doc", conversionOptions)
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
        
        // create an instance of ConversionOptions class.
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        byte[] result=await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",conversionOptions)
        if(result!=null)
        {
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(Byte[], String, ConversionOptions, Byte[])

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(Byte[] inputData, string inputFileName, ConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function ConvertAsync(inputData As Byte(), inputFileName As String, conversionOptions As ConversionOptions, appendToPdf As Byte()) As Task(Of Byte())

Parameters

inputData
Byte[]

Source byte array to be converted.

inputFileName
String

File name or extension of file which is stored as byte array.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

appendToPdf
Byte[]

Byte array for which output to be appended.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        Dim inputData() As Byte =File.ReadAllBytes("C:\MyDocument.doc")
        Dim appendToPdf() As Byte =File.ReadAllBytes("C:\MyDocument.pdf")
        
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
             
        Dim result = Await Converter.ConvertAsync(inputData, "C:\MyDocument.doc", conversionOptions, appendToPdf)
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
        byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");
     
        // create an instance of ConversionOptions class.
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        byte[] result= await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",conversionOptions, appendToPdf);
        while(true)
        {
            if(result!=null)
            {
                File.WriteAllBytes("C:/MyOutput.pdf",result);
            }
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(Byte[], String, String)

Performs Asynchronous conversion.

public static Task<bool> ConvertAsync(Byte[] inputData, string inputFileName, string outputFilePath)
Shared Function ConvertAsync(inputData As Byte(), inputFileName As String, outputFilePath As String) As Task(Of Boolean)

Parameters

inputData
Byte[]

Byte array of the source file that need to be converted.

inputFileName
String

File name or extension of the source file.

outputFilePath
String

File path to store the converted pdf.

Returns

Task<bool>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        Dim inputData() As Byte =File.ReadAllBytes("C:\MyDocument.doc")
        
        Dim result = Await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",  "C:\MyOutput.pdf")
        If (result) Then
            Console.WriteLine("Conversion Completed successfully")
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
        
        bool result=await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",  "C:\MyOutput.pdf")
        if(result)
        {
             Console.WriteLine("Conversion Completed successfully");
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(Byte[], String, String, ConversionOptions)

Performs Asynchronous conversion.

public static Task<bool> ConvertAsync(Byte[] inputData, string inputFileName, string outputFilePath, ConversionOptions conversionOptions)
Shared Function ConvertAsync(inputData As Byte(), inputFileName As String, outputFilePath As String, conversionOptions As ConversionOptions) As Task(Of Boolean)

Parameters

inputData
Byte[]

Byte array of the source file that need to be converted.

inputFileName
String

File name or extension of the source file.

outputFilePath
String

File path to store the converted pdf.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

Returns

Task<bool>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
        
        Dim inputData() As Byte =File.ReadAllBytes("C:\MyDocument.doc")
        
        Dim result = Await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",  "C:\MyOutput.pdf",conversionOptions)
        If (result) Then
            Console.WriteLine("Conversion Completed successfully")
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        // create an instance of ConversionOptions class
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
        
        bool result= await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",  "C:\MyOutput.pdf", conversionOptions)
        if(result)
        {
             Console.WriteLine("Conversion Completed successfully");
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(String)

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(string inputFilePath)
Shared Function ConvertAsync(inputFilePath As String) As Task(Of Byte())

Parameters

inputFilePath
String

Source file path for conversion.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
        
        Dim inputData() As Byte =File.ReadAllBytes("C:\MyDocument.doc")
        
        Dim result = Await Converter.ConvertAsync(inputData, "C:\MyDocument.doc",  "C:\MyOutput.pdf",conversionOptions)
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        
        byte[] result=await Converter.ConvertAsync( "C:\MyDocument.doc")
        if(result!=null)
        {
            File.WriteAllBytes("C:/MyOutput.pdf",result);
           
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(String, ConversionOptions)

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(string inputFilePath, ConversionOptions conversionOptions)
Shared Function ConvertAsync(inputFilePath As String, conversionOptions As ConversionOptions) As Task(Of Byte())

Parameters

inputFilePath
String

Source file path for conversion.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
             
        Dim result = Await Converter.ConvertAsync("C:\MyDocument.doc", conversionOptions)
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
     // create an instance of ConversionOptions class.
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        byte[] result=await Converter.ConvertAsync( "C:\MyDocument.doc",conversionOptions)
        if(result!=null)
        {
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(String, ConversionOptions, Byte[])

Performs Asynchronous conversion.

public static Task<Byte[]> ConvertAsync(string inputFilePath, ConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function ConvertAsync(inputFilePath As String, conversionOptions As ConversionOptions, appendToPdf As Byte()) As Task(Of Byte())

Parameters

inputFilePath
String

Source file path for conversion.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

appendToPdf
Byte[]

Byte array of the PDF to precede the converted output.

Returns

Task<Byte[]>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        Dim appendToPdf() As Byte =File.ReadAllBytes("C:\MyDocument.pdf")
        
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
             
        Dim result = Await Converter.ConvertAsync("C:\MyDocument.doc", conversionOptions,appendToPdf)
        If (result IsNot Nothing) Then
            File.WriteAllBytes("C:/MyOutput.pdf",result);
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        byte[] appendToPdf= File.ReadAllBytes("C:\MyDocument.pdf")
     // create an instance of ConversionOptions class.
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        byte[] result=await Converter.ConvertAsync( "C:\MyDocument.doc",conversionOptions,appendToPdf)
        if(result!=null)
        {
             File.WriteAllBytes("C:/MyOutput.pdf",result);
            
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(String, String)

Performs Asynchronous conversion.

public static Task<bool> ConvertAsync(string sourceFilePath, string outputFilePath)
Shared Function ConvertAsync(sourceFilePath As String, outputFilePath As String) As Task(Of Boolean)

Parameters

sourceFilePath
String

Source file path for conversion.

outputFilePath
String

File path to store the converted pdf.

Returns

Task<bool>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task

        Dim result = Await Converter.ConvertAsync("C:\MyDocument.doc",  "C:\MyOutput.pdf")
        If (result) Then
            Console.WriteLine("Conversion Completed successfully")
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        bool result= await Converter.ConvertAsync("C:\MyDocument.doc",  "C:\MyOutput.pdf")
        if(result)
        {
             Console.WriteLine("Conversion Completed successfully");
            
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

ConvertAsync(String, String, ConversionOptions)

Performs Asynchronous conversion.

public static Task<bool> ConvertAsync(string sourceFilePath, string outputFilePath, ConversionOptions conversionOptions)
Shared Function ConvertAsync(sourceFilePath As String, outputFilePath As String, conversionOptions As ConversionOptions) As Task(Of Boolean)

Parameters

sourceFilePath
String

Source file path for conversion.

outputFilePath
String

File path to store the converted pdf.

conversionOptions
ConversionOptions

Instance of ConversionOptions class that represents the conversion options.

Returns

Task<bool>

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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion

Module Module1

    Async Function run() As Task
    
        ' create an instance of ConversionOptions
        Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
        
        Dim result = Await Converter.ConvertAsync("C:\MyDocument.doc",  "C:\MyOutput.pdf", conversionOptions)
        If (result) Then
            Console.WriteLine("Conversion Completed successfully")
        End If
    End Function
    
    Sub Main()      
    
        run().Wait()

    End Sub

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

class MyClass
{
    static async Task run()
    {
        // create an instance of ConversionOptions class
        ConversionOptions conversionOptions = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
        
        bool result= await Converter.ConvertAsync("C:\MyDocument.doc",  "C:\MyOutput.pdf", conversionOptions)
        if(result)
        {
             Console.WriteLine("Conversion Completed successfully");
            
        }
    }
    static void Main()
    { 
        run().Wait();
    }   
}

See Also

Converter
ceTe.DynamicPDF.Conversion

In this topic