Converter.ConvertHtmlString

Overloads

ConvertHtmlString(String)Converts the HTML string to PDF and get the output PDF as byte array.
ConvertHtmlString(String, HtmlConversionOptions)Converts the HTML string to PDF and get the output PDF as byte array.
ConvertHtmlString(String, HtmlConversionOptions, Byte[])Converts the HTML string to PDF and get the output PDF as byte array.
ConvertHtmlString(String, String)Converts the HTML string to PDF of the given name.
ConvertHtmlString(String, String, HtmlConversionOptions)Converts the HTML string to PDF of the given name.

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

Byte[]

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:

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

Byte[]

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:

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

Byte[]

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:

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:

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:

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

See Also

Converter
ceTe.DynamicPDF.Conversion

In this topic