cete.dynamicpdf.conversion.htmlconverter
HtmlConverter
- Namespace: ceTe.DynamicPDF.Conversion
- Assemblies: DynamicPDF.Converter.NETFramework40.dll, DynamicPDF.Converter.NETStandard20.dll
Converts Html to Pdf
public class HtmlConverter
Public Class HtmlConverter
Inheritance: Object → HtmlConverter
Constructors
HtmlConverter(String)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(string htmlString)
Public Sub New (htmlString As String)
Parameters
- htmlString: String
HtmlConverter(String, HtmlConversionOptions)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(string htmlString, HtmlConversionOptions conversionOptions)
Public Sub New (htmlString As String, conversionOptions As HtmlConversionOptions)
Parameters
- htmlString: String
Content of the HTML source.
- conversionOptions: HtmlConversionOptions
Initializes the ConversionOptions property of the class.
HtmlConverter(String, Uri)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(string htmlString, Uri basePath)
Public Sub New (htmlString As String, basePath As Uri)
Parameters
HtmlConverter(String, Uri, HtmlConversionOptions)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(string htmlString, Uri basePath, HtmlConversionOptions conversionOptions)
Public Sub New (htmlString As String, basePath As Uri, conversionOptions As HtmlConversionOptions)
Parameters
- htmlString: String
Content of the HTML source.
- basePath: Uri
Base path to fetch HTML resorces like images, scripts etc. Relative links also resolved using this path.
- conversionOptions: HtmlConversionOptions
Initializes the ConversionOptions property of the class.
HtmlConverter(Uri)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(Uri uri)
Public Sub New (uri As Uri)
Parameters
- uri: Uri
path to the html file
HtmlConverter(Uri, HtmlConversionOptions)
Initializes a new instance of the HtmlConverter class.
public HtmlConverter(Uri uri, HtmlConversionOptions conversionOptions)
Public Sub New (uri As Uri, conversionOptions As HtmlConversionOptions)
Parameters
- uri: Uri
Uniform Resource Identifier for the HTML page.
- conversionOptions: HtmlConversionOptions
Initializes the ConversionOptions property of the class.
Properties
ConversionOptions
Gets an instance of HtmlConversionOptions class.
public HtmlConversionOptions ConversionOptions { get; }
Public Property ConversionOptions As HtmlConversionOptions
Property Value
Methods
AbortConversion()
Aborts the Asynchronous conversion
public void AbortConversion()
Sub AbortConversion()
Convert()
Converts Html to Pdf
public Byte[] Convert()
Function Convert() As Byte()
Returns
output pdf in byte array format
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
output pdf in byte array format
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
ConvertAsync()
Does the Asynchronous conversion
public void ConvertAsync()
Sub ConvertAsync()
ConvertAsync(Byte[])
Does the Asynchronous conversion
public void ConvertAsync(Byte[] pdfToAppendTo)
Sub ConvertAsync(pdfToAppendTo As Byte())
Parameters
- pdfToAppendTo: Byte[]
Contents of Pdf in byte array format, to which the current conversion needs to be appended to
ConvertAsync(String)
Does the Asynchronous conversion
public void ConvertAsync(string outputFilePath)
Sub ConvertAsync(outputFilePath As String)
Parameters
- outputFilePath: String
Path where the output file needs to be saved
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
Completed
Occurs when a document is successfully converted.
public event ConversionCompleted HtmlConverter.Completed;
Public Event HtmlConverter.Completed As ConversionCompleted
Event Handler
ProgressChanged
Occurs when the status of a document conversion changes.
public event ProgressChanged HtmlConverter.ProgressChanged;
Public Event HtmlConverter.ProgressChanged As ProgressChanged