HtmlConverter.Convert

Overloads

Convert()Converts Html to Pdf
Convert(Byte[])Converts Html to Pdf
Convert(String)Converts Html to Pdf

Convert()

Converts Html to Pdf

public Byte[] Convert()
Function Convert() As Byte()

Returns

Byte[]

returns a output pdf 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 use convert method with output byte array as return type.
Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()
  
   ' Create new instance of Converter by providing suitable parameters.
    Dim htmlConversion As HtmlConverter = New HtmlConverter("C:\MyDocument.html")

    ' Call Convert method to start conversion
    Dim output As Byte() = htmlConversion.Convert()
    
    If (output IsNot Nothing) Then
        'save byte array output to a file.
        File.WriteAllBytes("C:\MyOutputFile.pdf", output)
    End If

End Sub
 
End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
    static void Main()
    {        
        // Create new instance of Converter.
        HtmlConverter htmlConverter = new HtmlConverter(@"C:\MyDocument.html");
        
        //Call Convert method to start conversion
        byte []output=htmlConverter.Convert();
        
        if(output!=null)
        {
            //save byte array output to a file.
            File.WriteAllBytes("C:\MyOutputFile.pdf",output);
        }
    }
}

Convert(Byte[])

Converts Html to Pdf

public Byte[] Convert(Byte[] pdfToAppendTo)
Function Convert(pdfToAppendTo As Byte()) As Byte()

Parameters

pdfToAppendTo
Byte[]

Contents of Pdf in byte array format, to which the current conversion needs to be appended to

Returns

Byte[]

returns a Task where the result type is byte array

Licensing Info

This method is a DynamicPDF Converter feature. One of the following is required for non-evaluation usage:

Examples

This example shows how to use convert method with pdf byte array as parameter and byte array as return type.
Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()
  
   ' Create new instance of Converter by providing suitable parameters.
    Dim htmlConversion As HtmlConverter = New HtmlConverter("C:\MyDocument.html")

    ' Call Convert method to start conversion
    Dim output As Byte() = htmlConversion.Convert()
    
    If (output IsNot Nothing) Then
         Dim finalOutput As Byte() = htmlConversion.Convert(output)
         'save byte array output to a file.
         File.WriteAllBytes("C:\MyOutputFile.pdf", finalOutput)
    End If

End Sub
 
End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
    static void Main()
    {        
        // Create new instance of Converter.
        HtmlConverter htmlConverter = new HtmlConverter(@"C:\MyDocument.html");
        
        //Call Convert method to start conversion
        byte []output=htmlConverter.Convert();
        
        if(output!=null)
        {
             byte []finalOutputByte=htmlConverter.Convert(output);
             //save byte array output to a file.
             File.WriteAllBytes("C:\MyOutputFile.pdf",finalOutputByte);
        }
    }
}

Convert(String)

Converts Html to Pdf

public void Convert(string outputFilePath)
Sub Convert(outputFilePath As String)

Parameters

outputFilePath
String

Path where the output file needs to be saved

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 use convert method with outputFilePath as parameter.
Imports ceTe.DynamicPDF.Conversion

Module Module1

Sub Main()
  
   ' Create new instance of Converter by providing suitable parameters.
    Dim htmlConversion As HtmlConverter = New HtmlConverter("C:\MyDocument.html")

    ' Call Convert method to start conversion
    htmlConversion.Convert("C:\MyOutput.pdf")

End Sub
 
End Module
using ceTe.DynamicPDF.Conversion;

class MyClass
{
    static void Main()
    {        
        // Create new instance of Converter.
        HtmlConverter htmlConverter = new HtmlConverter(@"C:\MyDocument.html");
        
        //Call Convert method to start conversion
        htmlConverter.Convert(@"C:\MyOutput.pdf");
    }
}

See Also

HtmlConverter
ceTe.DynamicPDF.Conversion

In this topic