Pdf Duo .Net component
Open the Stream object with HTML content before converting to the PDF, reforming HTML's tags into PDF format structure.

Namespace: DuoDimension
Assembly: pdfduo-net (in pdfduo-net.dll) Version: 2.4.0.0 (2.4)

Syntax

         
 C#  Visual Basic  Visual C++ 
public void OpenHTML(
	Stream HtmlStream
)
Public Sub OpenHTML ( _
	HtmlStream As Stream _
)
public:
void OpenHTML(
	Stream^ HtmlStream
)

Parameters

HtmlStream
Stream
Html content in the form of Stream object.

Examples

CopyC#
string html_st = @"<p>The string example</p>";
MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(html_st));
string file_pdf = @"K:\new.pdf";

try
{
    DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf();
    conv.OpenHTML(ms);
    conv.SavePDF(file_pdf);
    System.Diagnostics.Process.Start(file_pdf);
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}
CopyVB.NET
Dim html_st As String = "<p>The string example</p>"
Dim ms As New IO.MemoryStream(System.Text.Encoding.Default.GetBytes(html_st))
Dim file_pdf As String = "K:\new.pdf"

Try
    Dim conv As New DuoDimension.HtmlToPdf()
    conv.OpenHTML(ms)
    conv.SavePDF(file_pdf)
    System.Diagnostics.Process.Start(file_pdf)
Catch ex As Exception
    MessageBox.Show(ex.Message)
End Try

See Also