Skip to main content

Converter

Version: 1.1

cete.dynamicpdf.conversion.converter

Converter​

Represents a synchronized conversion.

public class Converter
Public Class Converter

Inheritance: Object → Converter

Derived: AsyncConverter

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​

Returns​

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​

Source byte array to be converted.

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

Returns​

PDF stored in byte array.

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");
}
}

Convert(Byte[], String, ConversionOptions)​

Converts the source byte array to PDF.

public static Byte[] Convert(Byte[] inputData, string inputFileName, ConversionOptions options)
Shared Function Convert(inputData As Byte(), inputFileName As String, options As ConversionOptions) As Byte()

Parameters​

Source byte array to be converted.

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

Instance of ConversionOptions class that represents the conversion options.

Returns​

Converted PDF stored in byte array.

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);
}
}

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 options, Byte[] appendToPdf)
Shared Function Convert(inputData As Byte(), inputFileName As String, options As ConversionOptions, appendToPdf As Byte()) As Byte()

Parameters​

Source byte array to be converted.

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

Instance of ConversionOptions class that represents the conversion options.

Byte array for which output to be appended.

Returns​

Converted PDF stored in byte array.

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);
}
}

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​

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

File name or extension of the source file.

File path to store the converted pdf.

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​

Specifying the incorrect file name or extension for the inputFileName may result in conversion failure.

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 options)
Shared Sub Convert(inputData As Byte(), inputFileName As String, outputFilePath As String, options As ConversionOptions)

Parameters​

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

File name or extension of the source file.

File path to store the converted pdf.

Instance of ConversionOptions class that represents the conversion options.

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​

Specifying the incorrect file name or extension for the inputFileName may result in conversion failure.

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​

Source file path for conversion.

Returns​

Converted PDF stored in byte array.

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");
}
}

Convert(String, ConversionOptions)​

Converts the source file to PDF.

public static Byte[] Convert(string inputFilePath, ConversionOptions options)
Shared Function Convert(inputFilePath As String, options As ConversionOptions) As Byte()

Parameters​

Source file path for conversion.

Instance of ConversionOptions class that represents the conversion options.

Returns​

Converted PDF stored in byte array.

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);
}
}

Convert(String, ConversionOptions, Byte[])​

Converts the source file to PDF.

public static Byte[] Convert(string inputFilePath, ConversionOptions options, Byte[] appendToPdf)
Shared Function Convert(inputFilePath As String, options As ConversionOptions, appendToPdf As Byte()) As Byte()

Parameters​

Source file path for conversion.

Instance of ConversionOptions class that represents the conversion options.

Byte array of the PDF to precede the converted output.

Returns​

Converted PDF stored in byte array.

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);
}
}

Convert(String, String)​

Converts the source file to a PDF of the given name.

public static void Convert(string inputFilePath, string outputFilePath)
Shared Sub Convert(inputFilePath As String, outputFilePath As String)

Parameters​

Source file path for conversion.

File path to store the converted pdf.

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");
}
}

Convert(String, String, ConversionOptions)​

Converts the source file to a PDF of the given name.

public static void Convert(string inputFilePath, string outputFilePath, ConversionOptions conversionOptions)
Shared Sub Convert(inputFilePath As String, outputFilePath As String, conversionOptions As ConversionOptions)

Parameters​

Source file path for conversion.

File path to store the converted pdf.

Instance of ConversionOptions class that represents the conversion options.

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);
}
}

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​

HTML string for conversion.

Returns​

Converted PDF stored in byte array.

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);
}
}

ConvertHtmlString(String, HtmlConversionOptions)​

Converts the HTML string to PDF and get the output PDF as byte array.

public static Byte[] ConvertHtmlString(string htmlString, HtmlConversionOptions options)
Shared Function ConvertHtmlString(htmlString As String, options As HtmlConversionOptions) As Byte()

Parameters​

HTML string for conversion.

Instance of HtmlConversionOptions class that represents the HTML string conversion options.

Returns​

Converted PDF stored in byte array.

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, "basepath")

' 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, "basepath");

// Call ConvertHtmlString method to do conversion
byte[] MyData =Converter.ConvertHtmlString(htmlString, htmlConversionOptions);
}
}

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 options, Byte[] appendToPdf)
Shared Function ConvertHtmlString(htmlString As String, options As HtmlConversionOptions, appendToPdf As Byte()) As Byte()

Parameters​

HTML string for conversion.

Instance of HtmlConversionOptions class that represents the HTML string conversion options.

Byte array for which the output to be appended.

Returns​

Converted PDF stored in byte array.

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,"basepath")
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, "basepath");

byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");

// Call ConvertHtmlString method to do conversion
byte[] MyData =Converter.ConvertHtmlString(htmlString, htmlConversionOptions, appendToPdf);
}
}

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​

HTML string for conversion.

File path to store the converted pdf.

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");
}
}

ConvertHtmlString(String, String, HtmlConversionOptions)​

Converts the HTML string to PDF of the given name.

public static void ConvertHtmlString(string htmlString, string outputFilePath, HtmlConversionOptions options)
Shared Sub ConvertHtmlString(htmlString As String, outputFilePath As String, options As HtmlConversionOptions)

Parameters​

HTML string for conversion.

File path to store the converted pdf.

Instance of HtmlConversionOptions class that represents the HTML string conversion options.

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, "basepath")

' 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, "basepath");

// Call ConvertHtmlString method to do conversion
Converter.ConvertHtmlString(htmlString, @"C:\MyOutput.pdf", htmlConversionOptions);
}
}

ConvertHtmlStringToWeb(String)​

Converts the HTML string to PDF and outputs the PDF to ASPX page.

public static void ConvertHtmlStringToWeb(string htmlString)
Shared Sub ConvertHtmlStringToWeb(htmlString As String)

Parameters​

HTML string for conversion.

Examples​

This example shows how to convert HTML string to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"
' Call ConvertHtmlStringToWeb method to do conversion.
Converter.ConvertHtmlStringToWeb(htmlString)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";

// Call ConvertHtmlStringToWeb method to do conversion.
Converter.ConvertHtmlStringToWeb(htmlString);
}
}

ConvertHtmlStringToWeb(String, HtmlConversionOptions)​

Converts the HTML string to PDF and outputs the PDF to ASPX page.

public static void ConvertHtmlStringToWeb(string htmlString, HtmlConversionOptions options)
Shared Sub ConvertHtmlStringToWeb(htmlString As String, options As HtmlConversionOptions)

Parameters​

HTML string for conversion.

Instance of HtmlConversionOptions class that represents the HTML string conversion options.

Examples​

This example shows how to convert source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim htmlString As String = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>"

' Create a instance of HtmlConversionOptions
Dim htmlConversionOptions As HtmlConversionOptions = New HtmlConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, "basepath")

Converter.ConvertHtmlStringToWeb(htmlString, htmlConversionOptions)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";

// Create a instance of HtmlConversionOptions class.
HtmlConversionOptions option = new HtmlConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, "basepath");

// Call ConvertHtmlStringToWeb method to do conversion.
Converter.ConvertHtmlStringToWeb(htmlString, option);
}
}

ConvertHtmlStringToWeb(String, HtmlConversionOptions, Boolean, String, Boolean, Byte[])​

Converts the HTML string to PDF and outputs the PDF to ASPX page.

public static void ConvertHtmlStringToWeb(string htmlString, HtmlConversionOptions options, bool allowBrowserCaching, string downloadAsFileName, bool forceDownload, Byte[] appendToPdf)
Shared Sub ConvertHtmlStringToWeb(htmlString As String, options As HtmlConversionOptions, allowBrowserCaching As Boolean, downloadAsFileName As String, forceDownload As Boolean, appendToPdf As Byte())

Parameters​

HTML string for conversion.

Instance of HtmlConversionOptions class that represents the HTML string conversion options.

Specifies if the browser should be allowed to cache the PDF Document.

Specifies the file name of the document if it is downloaded.

Specifies if the Save As dialog should appear.

Byte array for which the output to be appended.

Examples​

This example shows how to convert byte array of source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System.IO

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

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 ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, True,"basePath")

Dim appendToPdf() As Byte = File.ReadAllBytes("C:\MyDocument.pdf")

Converter.ConvertToWeb(htmlString, htmlConversionOptions, True, "MyDocument.Pdf", True, appendToPdf)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string htmlString = "<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";

// Create a instance of HtmlConversionOptions class.
HtmlConversionOptions option = new HtmlConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, true, "basePath");

byte[] appendToPdf = File.ReadAllBytes(@"C:\MyDocument.pdf");

// Call ConvertHtmlStringToWeb method to do conversion.
Converter.ConvertToWeb(htmlString, option, true, "MyDocument.Pdf", true, appendToPdf);
}
}

ConvertToWeb(Byte[], String)​

Converts the byte array of the source file to PDF and outputs to current ASPX page.

public static void ConvertToWeb(Byte[] inputData, string inputFileName)
Shared Sub ConvertToWeb(inputData As Byte(), inputFileName As String)

Parameters​

Source byte array to be converted.

File name or extension of file to be converted.

Examples​

This example shows how to convert byte array of source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System.IO

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")

Converter.ConvertToWeb(inputData, ".doc")

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");

// Call ConvertToWeb method to do conversion.
Converter.ConvertToWeb(inputData, @".doc");
}
}

ConvertToWeb(Byte[], String, ConversionOptions)​

Converts the byte array of the source file to PDF and outputs to current ASPX page.

public static void ConvertToWeb(Byte[] inputData, string inputFileName, ConversionOptions options)
Shared Sub ConvertToWeb(inputData As Byte(), inputFileName As String, options As ConversionOptions)

Parameters​

Source byte array to be converted.

File name or extension of file to be converted.

Instance of ConversionOptions class that represents the conversion options.

Examples​

This example shows how to convert byte array of source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System.IO

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

// Create a instance of ConversionOptions class.
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)

Dim inputData() As Byte = File.ReadAllBytes("C:\MyDocument.doc")

Converter.ConvertToWeb(inputData, ".doc", conversionOptions)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter,PageOrientation.Portrait,75);

byte[] inputData = File.ReadAllBytes(@"C:\MyDocument.doc");

// Call ConvertToWeb method to do conversion.
Converter.ConvertToWeb(inputData, @".doc", option);
}
}

ConvertToWeb(Byte[], String, ConversionOptions, Boolean, String, Boolean, Byte[])​

Converts the byte array of the source file to PDF and outputs to current ASPX page.

public static void ConvertToWeb(Byte[] inputData, string inputFileName, ConversionOptions options, bool allowBrowserCaching, string downloadAsFileName, bool forceDownload, Byte[] appendToPdf)
Shared Sub ConvertToWeb(inputData As Byte(), inputFileName As String, options As ConversionOptions, allowBrowserCaching As Boolean, downloadAsFileName As String, forceDownload As Boolean, appendToPdf As Byte())

Parameters​

Source byte array to be converted.

File name or extension of file to be converted.

Instance of ConversionOptions class that represents the conversion options.

Specifies if the browser should be allowed to cache the PDF Document.

Specifies the file name of the document if it is downloaded.

Specifies if the Save As dialog should appear.

Byte array for which the output to be appended.

Examples​

This example shows how to convert byte array of source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System.IO

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

// Create a instance of ConversionOptions class.
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 ConvertToWeb method to do conversion.
Converter.ConvertToWeb(inputData, ".doc", conversionOptions, True, "MyDocument.Pdf", True, appendToPdf)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// 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 ConvertToWeb method to do conversion.
Converter.ConvertToWeb(inputData, @".doc", option, true, "MyDocument.Pdf", true, appendToPdf);
}
}

ConvertToWeb(String)​

Converts the source file to PDF and outputs to current ASPX page.

public static void ConvertToWeb(string inputFilePath)
Shared Sub ConvertToWeb(inputFilePath As String)

Parameters​

Source file path for conversion.

Examples​

This example shows how to convert source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Converter.ConvertToWeb("C:\MyDocument.doc")

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Call ConvertToWeb method to do conversion.
Converter.ConvertToWeb(@"C:\MyDocument.doc");
}
}

ConvertToWeb(String, ConversionOptions)​

Converts the source file to PDF and outputs to current ASPX page.

public static void ConvertToWeb(string inputFilePath, ConversionOptions options)
Shared Sub ConvertToWeb(inputFilePath As String, options As ConversionOptions)

Parameters​

Source file path for conversion.

Instance of ConversionOptions class that represents the conversion options.

Examples​

This example shows how to convert source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

' Create a instance of ConversionOptions
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75)

Converter.ConvertToWeb("C:\MyDocument.doc", conversionOptions)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create a instance of ConversionOptions class.
ConversionOptions option = new ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75f);

// Call ConvertToWeb method to do conversion.
Converter.ConvertToWeb(@"C:\MyDocument.doc", option);
}
}

ConvertToWeb(String, ConversionOptions, Boolean, String, Boolean, Byte[])​

Converts the source file to PDF and outputs the PDF to ASPX page.

public static void ConvertToWeb(string inputFilePath, ConversionOptions options, bool allowBrowserCaching, string downloadAsFileName, bool forceDownload, Byte[] appendToPdf)
Shared Sub ConvertToWeb(inputFilePath As String, options As ConversionOptions, allowBrowserCaching As Boolean, downloadAsFileName As String, forceDownload As Boolean, appendToPdf As Byte())

Parameters​

The path to the file to be converted.

Instance of ConversionOptions class that represents the conversion options.

Specifies if the browser should be allowed to cache the PDF Document.

Specifies the file name of the document if it is downloaded.

Specifies if the Save As dialog should appear.

Byte array for which the output to be appended.

Examples​

This example shows how to convert byte array of source file to PDF and ouput to current ASPX page.

Imports ceTe.DynamicPDF.Conversion
Imports System.IO

Public Class MyConversion
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

// Create a instance of ConversionOptions class.
Dim conversionOptions As ConversionOptions = New ConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, True)

Dim appendToPdf() As Byte = File.ReadAllBytes("C:\MyDocument.pdf")

Converter.ConvertToWeb("C:\MyDocument.pdf", conversionOptions, True, "MyDocument.Pdf", True, appendToPdf)

End Sub

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

class MyClass : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// 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 ConvertToWeb method to do conversion.
Converter.ConvertToWeb(@"C:\MyDocument.pdf", option, true, "MyDocument.Pdf", true, appendToPdf);
}
}

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

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 .

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.

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 .

Events​

ConversionError​

Occurs when a conversion error occurs.

public event ConversionErrorEventHandler Converter.ConversionError;
Public Event Converter.ConversionError As ConversionErrorEventHandler

Event Handler​

ConversionErrorEventHandler

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​

ConvertedEventHandler

Remarks​

Used when the conversion is of type Async.

See Also​

ceTe.DynamicPDF.Conversion