using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.IO;
namespace HTML_File_To_PDF
{
class Program
{
static void Main(string[] args)
{
//Initialize the HTML to PDF converter with the Blink rendering engine.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the BlinkBinaries folder path.
blinkConverterSettings.BlinkPath = @"../../../../../BlinkBinariesWindows/";
//Assign Blink converter settings to HTML converter.
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert HTML string to PDF.
PdfDocument document = htmlConverter.Convert("<h1>Hello world</h1>","");
FileStream fileStream = new FileStream("Sample.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite);
//Save and close the PDF document .
document.Save(fileStream);
document.Close(true);
}
}
}