cete.dynamicpdf.conversion.converter
Converter
- Namespace: ceTe.DynamicPDF.Conversion
- Assemblies: DynamicPDF.Converter.dll
Represents a synchronized conversion.Defines method and properties for Conversion.
public class Converter
Public Class Converter
Inheritance: Object → Converter
Derived: AsyncConverter
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 source file to PDF file.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Call convert method to do conversion
Converter.Convert("C:\MyDocument.doc", "C:\MyOutput.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Call convert method to do conversion
Converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf");
}
}
Remarks
For Asynchronized conversion, refer AsyncConverter .
Methods
AddLicense(String)
Adds a license key to license the product. True, if the license is valid.
public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean
Parameters
- licenseKey: String
Returns
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.
Convert(Byte[], String)
Converts the source byte array to PDF.
public static Byte[] Convert(Byte[] inputData, string inputFileName)
Shared Function Convert(inputData As Byte(), inputFileName As String) As 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
PDF stored in byte array.
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 convert byte array of the source file to PDF file and returns converted PDF in byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert(inputData, ".doc")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
using System.IO;
class MyClass
{
static void Main()
{
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(inputData, @".doc");
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(Byte[], String, ConversionOptions)
Converts the source byte array to PDF.
public static Byte[] Convert(Byte[] inputData, string inputFileName, ConversionOptions conversionOptions)
Shared Function Convert(inputData As Byte(), inputFileName As String, conversionOptions As ConversionOptions) As 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
Converted PDF stored in byte array.
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 convert byte array of the source file to PDF file and returns converted PDF in byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert(inputData, ".doc", conversionOptions)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
using System.IO;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(inputData , @".doc", option);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(Byte[], String, ConversionOptions, Byte[])
Converts the source byte array to PDF and get the output as byte array.
public static Byte[] Convert(Byte[] inputData, string inputFileName, ConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function Convert(inputData As Byte(), inputFileName As String, conversionOptions As ConversionOptions, appendToPdf As Byte()) As 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
Converted PDF stored in byte array.
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 convert byte array of the source file to PDF and append to the existing byte array of PDF.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, True)
Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")
Dim appendToPdf() As Byte = File.ReadAllBytes("C:\MyDocument.pdf")
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert(inputData, ".doc", conversionOptions, appendToPdf)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
using System.IO;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, true);
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(inputData , @".doc", option, appendToPdf);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(Byte[], String, String)
Converts the source byte array to a PDF of the given name.
public static void Convert(Byte[] inputData, string inputFileName, string outputFilePath)
Shared Sub Convert(inputData As Byte(), inputFileName As String, outputFilePath As String)
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.
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 convert byte array of the source file to PDF file.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")
' Call convert method to do conversion
Converter.Convert(inputData, ".doc", "C:\MyOutput.pdf")
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
// Call convert method to do conversion
Converter.Convert(inputData, @".doc", @"C:\MyOutput.pdf");
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(Byte[], String, String, ConversionOptions)
Converts the source byte array to a PDF of the given name.
public static void Convert(Byte[] inputData, string inputFileName, string outputFilePath, ConversionOptions conversionOptions)
Shared Sub Convert(inputData As Byte(), inputFileName As String, outputFilePath As String, conversionOptions As ConversionOptions)
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.
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 convert byte array of the source file to PDF file.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")
' Call convert method to do conversion
Converter.Convert(inputData, ".doc", "C:\MyOutput.pdf", conversionOptions)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");
// Call convert method to do conversion
Converter.Convert(inputData, @".doc", @"C:\MyOutput.pdf", option);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(String)
Converts the source file to PDF and get the output as byte array.
public static Byte[] Convert(string inputFilePath)
Shared Function Convert(inputFilePath As String) As Byte()
Parameters
- inputFilePath: String
Source file path for conversion.
Returns
Converted PDF stored in byte array.
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 convert source file to PDF file and returns the converted PDF in byte array.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert("C:\MyDocument.doc")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(@"C:\MyDocument.doc");
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(String, ConversionOptions)
Converts the source file to PDF.
public static Byte[] Convert(string inputFilePath, ConversionOptions conversionOptions)
Shared Function Convert(inputFilePath As String, conversionOptions As ConversionOptions) As Byte()
Parameters
- inputFilePath: String
Source file path for conversion.
- conversionOptions: ConversionOptions
Instance of ConversionOptions class that represents the conversion options.
Returns
Converted PDF stored in byte array.
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 convert source file to PDF file and returns the converted PDF in byte array.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert("C:\MyDocument.doc", conversionOptions)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(@"C:\MyDocument.doc", option);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(String, ConversionOptions, Byte[])
Converts the source file to PDF.
public static Byte[] Convert(string inputFilePath, ConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function Convert(inputFilePath As String, conversionOptions As ConversionOptions, appendToPdf As Byte()) As 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
Converted PDF stored in byte array.
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 convert source file to PDF file and returns the converted PDF in byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions((PageSize.Letter, PageOrientation.Portrait, 75, 75, True)
Dim appendToPdf() As Byte = File.ReadAllBytes("C:\MyDocument.pdf")
' Call convert method to do conversion
Dim MyData() As Byte = Converter.Convert("C:\MyDocument.doc", ConversionOptions, appendToPdf)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter,PageOrientation.Portrait,75,75, true);
byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");
// Call convert method to do conversion.
byte[] pdfData = Converter.Convert(@"C:\MyDocument.doc", option, appendToPdf);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(String, String)
Converts the source file to a PDF of the given name.
public static void Convert(string sourceFilePath, string outputFilePath)
Shared Sub Convert(sourceFilePath As String, outputFilePath As String)
Parameters
- sourceFilePath: String
Source file path for conversion.
- outputFilePath: String
File path to store 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 convert source file to PDF file.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Call convert method to do conversion
Converter.Convert("C:\MyDocument.doc", "C:\MyOutput.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Call convert method to do conversion
Converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf");
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
Convert(String, String, ConversionOptions)
Converts the source file to a PDF of the given name.
public static void Convert(string sourceFilePath, string outputFilePath, ConversionOptions conversionOptions)
Shared Sub Convert(sourceFilePath As String, outputFilePath As String, conversionOptions As ConversionOptions)
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.
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 convert source file to PDF file.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)
' Call convert method to do conversion
Converter.Convert("C:\MyDocument.doc", "C:\MyOutput.pdf", conversionOptions)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
// Create a instance of ConversionOptions class
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75);
// Call convert method to do conversion
Converter.Convert(@"C:\MyDocument.doc", @"C:\MyOutput.pdf", option);
}
}
Remarks
Use respective Converter classes for specific file type WordConverter , ExcelConverter , PowerPointConverter , HtmlConverter , ImageConverter , TextConverter instead.
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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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
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:
- 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 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();
}
}
ConvertHtmlString(String)
Converts the HTML string to PDF and get the output PDF as byte array.
public static Byte[] ConvertHtmlString(string htmlString)
Shared Function ConvertHtmlString(htmlString As String) As Byte()
Parameters
- htmlString: String
HTML string for conversion.
Returns
Converted PDF stored in byte array.
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 convert HTML string to PDF and get the output as byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlString method to do conversion
Dim MyData() As Byte = Converter.ConvertHtmlString(htmlString)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlString method to do conversion
byte[] MyData = Converter.ConvertHtmlString(htmlString);
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlString(String, HtmlConversionOptions)
Converts the HTML string to PDF and get the output PDF as byte array.
public static Byte[] ConvertHtmlString(string htmlString, HtmlConversionOptions conversionOptions)
Shared Function ConvertHtmlString(htmlString As String, conversionOptions As HtmlConversionOptions) As Byte()
Parameters
- htmlString: String
HTML string for conversion.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
Returns
Converted PDF stored in byte array.
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 convert HTML string to PDF and get the output as byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Create a instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
' Call ConvertHtmlString method to do conversion
Dim MyData() As Byte = Converter.ConvertHtmlString(htmlString, htmlConversionOptions)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Create a instance of HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50);
// Call ConvertHtmlString method to do conversion
byte[] MyData =Converter.ConvertHtmlString(htmlString, htmlConversionOptions);
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlString(String, HtmlConversionOptions, Byte[])
Converts the HTML string to PDF and get the output PDF as byte array.
public static Byte[] ConvertHtmlString(string htmlString, HtmlConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function ConvertHtmlString(htmlString As String, conversionOptions As HtmlConversionOptions, appendToPdf As Byte()) As Byte()
Parameters
- htmlString: String
HTML string for conversion.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
- appendToPdf: Byte[]
Byte array for which the output to be appended.
Returns
Converted PDF stored in byte array.
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 convert HTML string to PDF and get the output as byte array.
Imports ceTe.DynamicPDF.Conversion
Imports System.IO
Module Module1
Sub Main()
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Create a instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50,50,True)
Dim appendToPdf() As Byte = File.ReadAllBytes("C:\MyDocument.pdf")
' Call ConvertHtmlString method to do conversion
Dim MyData() As Byte = Converter.ConvertHtmlString(htmlString, htmlConversionOptions, appendToPdf)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Create a instance of HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50,50,true);
byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");
// Call ConvertHtmlString method to do conversion
byte[] MyData =Converter.ConvertHtmlString(htmlString, htmlConversionOptions, appendToPdf);
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlString(String, String)
Converts the HTML string to PDF of the given name.
public static void ConvertHtmlString(string htmlString, string outputFilePath)
Shared Sub ConvertHtmlString(htmlString As String, outputFilePath As String)
Parameters
- htmlString: String
HTML string for conversion.
- outputFilePath: String
File path to store 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 convert HTML string to PDF file.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlString method to do conversion
Converter.ConvertHtmlString(htmlString, "C:\MyOutput.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlString method to do conversion
Converter.ConvertHtmlString(htmlString, @"C:\MyOutput.pdf");
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlString(String, String, HtmlConversionOptions)
Converts the HTML string to PDF of the given name.
public static void ConvertHtmlString(string htmlString, string outputFilePath, HtmlConversionOptions conversionOptions)
Shared Sub ConvertHtmlString(htmlString As String, outputFilePath As String, conversionOptions As HtmlConversionOptions)
Parameters
- htmlString: String
HTML string for conversion.
- outputFilePath: String
File path to store the converted pdf.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
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 convert HTML string to PDF file.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Sub Main()
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Create a instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
' Call ConvertHtmlString method to do conversion
Converter.ConvertHtmlString(htmlString, "C:\MyOutput.pdf", htmlConversionOptions)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static void Main()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Create a instance of HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50);
// Call ConvertHtmlString method to do conversion
Converter.ConvertHtmlString(htmlString, @"C:\MyOutput.pdf", htmlConversionOptions);
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlStringAsync(String)
Converts the HTML string to PDF of the given name.
public static Task<Byte[]> ConvertHtmlStringAsync(string htmlString)
Shared Function ConvertHtmlStringAsync(htmlString As String) As Task(Of Byte())
Parameters
- htmlString: String
HTML string for conversion.
Returns
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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Async Function run() As Task
' create an instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlStringAsync method to do conversion
Dim result() As Byte=Await Converter.ConvertHtmlStringAsync(htmlString)
File.WriteAllBytes("C:\MyOutput.pdf",result)
End Function
Sub Main()
run().Wait()
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static async Task run()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlStringAsync method to do conversion
byte[] result= await Converter.ConvertHtmlStringAsync(htmlString);
File.WriteAllBytes("C:\MyOutput.pdf",result);
}
static void Main()
{
run().Wait();
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlStringAsync(String, HtmlConversionOptions)
Converts the HTML string to PDF of the given name.
public static Task<Byte[]> ConvertHtmlStringAsync(string htmlString, HtmlConversionOptions conversionOptions)
Shared Function ConvertHtmlStringAsync(htmlString As String, conversionOptions As HtmlConversionOptions) As Task(Of Byte())
Parameters
- htmlString: String
HTML string for conversion.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
Returns
Converted PDF stored in byte array.
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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Async Function run() As Task
' create an instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlStringAsync method to do conversion
Dim result() As Byte= Await Converter.ConvertHtmlStringAsync(htmlString, htmlConversionOptions)
File.WriteAllBytes("C:\MyOutput.pdf",result)
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 HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50);
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlStringAsync method to do conversion
byte[] result=await Converter.ConvertHtmlStringAsync(htmlString,htmlConversionOptions);
File.WriteAllBytes("C:\MyOutput.pdf",result);
}
static void Main()
{
run().Wait();
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlStringAsync(String, HtmlConversionOptions, Byte[])
Converts the HTML string to PDF of the given name.
public static Task<Byte[]> ConvertHtmlStringAsync(string htmlString, HtmlConversionOptions conversionOptions, Byte[] appendToPdf)
Shared Function ConvertHtmlStringAsync(htmlString As String, conversionOptions As HtmlConversionOptions, appendToPdf As Byte()) As Task(Of Byte())
Parameters
- htmlString: String
HTML string for conversion.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
- appendToPdf: Byte[]
Byte array of the PDF to precede the converted output.
Returns
Converted PDF stored in byte array.
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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Async Function run() As Task
' create an instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
Dim appendToPdf() As Byte =File.ReadAllBytes("C:\MyDocument.pdf")
' Call ConvertHtmlStringAsync method to do conversion
Dim MyData() As Byte =Await Converter.ConvertHtmlStringAsync(htmlString, htmlConversionOptions, appendToPdf)
File.WriteAllBytes("C:\MyOutput.pdf",MyData)
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 HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50);
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");
// Call ConvertHtmlStringAsync method to do conversion
byte[] MyData =await Converter.ConvertHtmlStringAsync(htmlString, htmlConversionOptions, appendToPdf);
File.WriteAllBytes("C:\MyOutput.pdf",MyData);
}
static void Main()
{
run().Wait();
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlStringAsync(String, String)
Converts the HTML string to PDF of the given name.
public static Task<bool> ConvertHtmlStringAsync(string htmlString, string outputFilePath)
Shared Function ConvertHtmlStringAsync(htmlString As String, outputFilePath As String) As Task(Of Boolean)
Parameters
- htmlString: String
HTML string for conversion.
- outputFilePath: String
File path to store the converted pdf.
Returns
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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Async Function run() As Task
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlStringAsync method to do conversion
Await Converter.ConvertHtmlStringAsync(htmlString, "C:\MyOutput.pdf")
End Function
Sub Main()
run().Wait()
End Sub
End Module
using System;
using ceTe.DynamicPDF.Conversion;
class MyClass
{
static async Task run()
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlStringAsync method to do conversion
await Converter.ConvertHtmlStringAsync(htmlString, @"C:\MyOutput.pdf");
}
static void Main()
{
run().Wait();
}
}
Remarks
Use HtmlConverter class instead
ConvertHtmlStringAsync(String, String, HtmlConversionOptions)
Converts the HTML string to PDF of the given name.
public static Task<bool> ConvertHtmlStringAsync(string htmlString, string outputFilePath, HtmlConversionOptions conversionOptions)
Shared Function ConvertHtmlStringAsync(htmlString As String, outputFilePath As String, conversionOptions As HtmlConversionOptions) As Task(Of Boolean)
Parameters
- htmlString: String
HTML string for conversion.
- outputFilePath: String
File path to store the converted pdf.
- conversionOptions: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
Returns
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 convert source file to PDF file using ConvertAsync.
Imports ceTe.DynamicPDF.Conversion
Module Module1
Async Function run() As Task
' create an instance of HtmlConversionOptions class.
Dim htmlConversionOptions As HtmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50)
Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlStringAsync method to do conversion
Await Converter.ConvertHtmlStringAsync(htmlString, "C:\MyOutput.pdf", htmlConversionOptions)
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 HtmlConversionOptions class.
HtmlConversionOptions htmlConversionOptions = new HtmlConversionOptions(PageSize.Letter,PageOrientation.Portrait, 50);
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
// Call ConvertHtmlString method to do conversion
await Converter.ConvertHtmlStringAsync(htmlString, @"C:\MyOutput.pdf", htmlConversionOptions);
}
static void Main()
{
run().Wait();
}
}
Remarks
Use HtmlConverter class instead
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.
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.
Events
ConversionError
Occurs when a conversion error occurs.
public event ConversionErrorEventHandler Converter.ConversionError;
Public Event Converter.ConversionError As ConversionErrorEventHandler
Event Handler
Licensing Info
This event 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.
Remarks
Used when the conversion is of type Async.
Converted
Occurs when a document is successfully converted.
public event ConvertedEventHandler Converter.Converted;
Public Event Converter.Converted As ConvertedEventHandler
Event Handler
Licensing Info
This event 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.
Remarks
Used when the conversion is of type Async.
ProgressChanged
Occurs when the status of a document conversion changes.
public event ProgressChanged Converter.ProgressChanged;
Public Event Converter.ProgressChanged As ProgressChanged
Event Handler
Licensing Info
This event 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.