I have some "big" html files 4Mb+.
Then i convert one file to PDF via Pechkin (.NET Wrapper for WkHtmlToPdf static DLL) I can safely go to sleep about 3-5 minutes.
Output PDF has 2Mb+ and about 500 pages inside.
var html = "...html...";
var data = HtmlToPdf2(res);
Console.WriteLine("HtmlToPdf2 done: " + sw.Elapsed);
...
private static byte[] HtmlToPdf2(string html)
{
var pechkin = new SimplePechkin(new GlobalConfig());
var pdf = pechkin.Convert(new ObjectConfig()
.SetLoadImages(true)
.SetZoomFactor(1.5)
.SetPrintBackground(true)
.SetScreenMediaType(true)
.SetCreateExternalLinks(true)
,html);
}
My stopwatch say:
Start: 00:00:00.0007693
TransformXMLToHTML done: 00:00:03.6661490
HtmlToPdf2 done: 00:03:50.7784590
WriteAllBytes done: 00:03:50.7871326
My users will cry when they wait so long.