Asynchronous Conversion
Converting HTML to a PDF asynchronously uses the Converter.ConvertAsync method and, like they synchronous method, offers two overloaded options for converting either a URL or HTML text.
Web URL to PDF
Converting HTML to PDF using a URL requires passing a URL and an output path for the converted PDF to the Converter.ConvertAsync method. The following C# and VB .NET example illustrates.
Converter.ConvertAsync(new Uri("http://www.google.com"), "output.pdf");
Converter.ConvertAsync(New Uri("http://www.google.com"), "output.pdf")
HTML string to PDF
Converting an HTML string to an output file path asynchronously is also straight-forward, as the following C# and VB .NET examples illustrate.
Converter.ConvertAsync(htmlString, "output.pdf");
Converter.ConvertAsync(htmlString, "output.pdf")
Converting to a Byte Array
Converting to a byte array is accomplished using the Converter.ConvertAsync method, only it returns a byte array rather than a file. The following example illustrates.
byte[] vals = await Converter.ConvertAsync(resolvePath);