2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
The Syncfusion HTML to PDF converter for .NET is used to convert webpages, SVG, MHTML, and HTML to PDF. Using this library, you can convert HTML to PDF in Azure website using C# and VB.NET. Steps to convert HTML to PDF in Azure website programmatically:
UG: https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf // [C# Code] using Syncfusion.HtmlConverter; using Syncfusion.Pdf; using System.IO;
public ActionResult ExportToPDF() { //Initialize HTML to PDF converter HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit); WebKitConverterSettings settings = new WebKitConverterSettings(); //Set WebKit path settings.WebKitPath = Server.MapPath("~/QtBinaries/"); //Assign WebKit settings to HTML converter htmlConverter.ConverterSettings = settings; //Convert URL to PDF PdfDocument document = htmlConverter.Convert("http://www.google.com"); MemoryStream stream = new MemoryStream(); //Save and close the PDF document document.Save(stream); return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "Sample.pdf"); }
Refer to the following steps to publish as Azure web application:
A complete working sample can be downloaded from HTMLToPDF_Azure.zip. Refer here to include the OPENSSL assemblies in Azure website. Take a moment to peruse the documentation for Converting HTML to PDF, where you will find various options for URL to PDF, HTML string to PDF, and Hyperlinks. Refer here to explore the rich set of Syncfusion Essential PDF features. |
2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.