cete.dynamicpdf.conversion.converter
Converter
- Namespace: ceTe.DynamicPDF.Conversion
- Assemblies: DynamicPDF.Converter.NETFramework40.dll, DynamicPDF.Converter.NETStandard20.dll
Represents a synchronized conversion.Defines method and properties for 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
- licenseKey: String
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
- 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.
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 options)
Shared Function Convert(inputData As Byte(), inputFileName As String, options 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.
- options: ConversionOptions
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);
}
}
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 options, Byte[] appendToPdf)
Shared Function Convert(inputData As Byte(), inputFileName As String, options 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.
- options: 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.
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.
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 options)
Shared Sub Convert(inputData As Byte(), inputFileName As String, outputFilePath As String, options 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.
- options: ConversionOptions
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
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.
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 options)
Shared Function Convert(inputFilePath As String, options As ConversionOptions) As Byte()
Parameters
- inputFilePath: String
Source file path for conversion.
- options: ConversionOptions
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);
}
}
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 options, Byte[] appendToPdf)
Shared Function Convert(inputFilePath As String, options As ConversionOptions, appendToPdf As Byte()) As Byte()
Parameters
- inputFilePath: String
Source file path for conversion.
- options: 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.
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.
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.
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.
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.
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 options)
Shared Function ConvertHtmlString(htmlString As String, options As HtmlConversionOptions) As Byte()
Parameters
- htmlString: String
HTML string for conversion.
- options: HtmlConversionOptions
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)
' 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 options, Byte[] appendToPdf)
Shared Function ConvertHtmlString(htmlString As String, options As HtmlConversionOptions, appendToPdf As Byte()) As Byte()
Parameters
- htmlString: String
HTML string for conversion.
- options: 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.
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.
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 options)
Shared Sub ConvertHtmlString(htmlString As String, outputFilePath As String, options As HtmlConversionOptions)
Parameters
- htmlString: String
HTML string for conversion.
- outputFilePath: String
File path to store the converted pdf.
- options: HtmlConversionOptions
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)
' 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
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
- htmlString: String
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
- htmlString: String
HTML string for conversion.
- options: HtmlConversionOptions
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)
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);
// 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
- htmlString: String
HTML string for conversion.
- options: HtmlConversionOptions
Instance of HtmlConversionOptions class that represents the HTML string conversion options.
- allowBrowserCaching: Boolean
Specifies if the browser should be allowed to cache the PDF Document.
- downloadAsFileName: String
Specifies the file name of the document if it is downloaded.
- forceDownload: Boolean
Specifies if the Save As dialog should appear.
- appendToPdf: Byte[]
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 HtmlConversionOptions(PageSize.Letter, PageOrientation.Portrait, 75, 75, True)
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);
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
- inputData: Byte[]
Source byte array to be converted.
- inputFileName: String
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
- inputData: Byte[]
Source byte array to be converted.
- inputFileName: String
File name or extension of file to be converted.
- options: ConversionOptions
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
- inputData: Byte[]
Source byte array to be converted.
- inputFileName: String
File name or extension of file to be converted.
- options: ConversionOptions
Instance of ConversionOptions class that represents the conversion options.
- allowBrowserCaching: Boolean
Specifies if the browser should be allowed to cache the PDF Document.
- downloadAsFileName: String
Specifies the file name of the document if it is downloaded.
- forceDownload: Boolean
Specifies if the Save As dialog should appear.
- appendToPdf: Byte[]
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
- inputFilePath: String
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
- inputFilePath: String
Source file path for conversion.
- options: ConversionOptions
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
- inputFilePath: String
The path to the file to be converted.
- options: ConversionOptions
Instance of ConversionOptions class that represents the conversion options.
- allowBrowserCaching: Boolean
Specifies if the browser should be allowed to cache the PDF Document.
- downloadAsFileName: String
Specifies the file name of the document if it is downloaded.
- forceDownload: Boolean
Specifies if the Save As dialog should appear.
- appendToPdf: Byte[]
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.doc")
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.doc");
// 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
- obj: Object
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
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
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