Table of Contents
HtmlToPdf.ConvertHtml Method (String, Stream, HtmlToPdfOptions)

Convert HTML text to PDF and write output to a Stream object.

Syntax
 public static HtmlToPdfResult ConvertHtml(
   string html,
   Stream stream,
   HtmlToPdfOptions options
);

Parameters

html
The html text.
stream
The output stream.
options
The conversion options that would override Options if specified.

Return Value

Returns a HtmlToPdfResult object that contains additional information about the conversion.

Remarks

Use this version to save the PDF directly to a stream without creating a file, which is especially useful in a Web application. For example, the following saves the output directly to the OutputStream of the current HttpResponse object.

//Convert Url to PDF and send the result directly to the client
HtmlToPdf.ConvertUrl("http://www.google.com", Response.OutputStream);
Note: Usually you must set HtmlToPdf.Options.BaseUrl before calling this method.
See Also