using ConsoleNetStandard;
using System.Diagnostics;
using Telerik.Windows.Documents.Flow.FormatProviders.Html;
using Telerik.Windows.Documents.Flow.FormatProviders.Pdf;
using Telerik.Windows.Documents.Flow.Model;

Telerik.Windows.Documents.Extensibility.FontsProviderBase fontsProvider = new FontsProvider();
Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.FontsProvider = fontsProvider;

RadFlowDocument document;
HtmlFormatProvider htmlFormatProvider = new HtmlFormatProvider();

using (Stream input = File.OpenRead("..\\..\\..\\..\\input.html"))
{
    document = htmlFormatProvider.Import(input);
}

PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
using (Stream output = File.OpenWrite("..\\..\\..\\..\\output.pdf"))
{
    pdfFormatProvider.Export(document, output);
}

var psi = new ProcessStartInfo()
{
    FileName = "..\\..\\..\\..\\output.pdf",
    UseShellExecute = true
};
Process.Start(psi);