나는 "큰"html 파일 4MB +를 가지고있다.HTML을 Pdf로 변환하는 가장 빠른 방법은 무엇입니까?
그럼 Pechkin (.NET Wrapper for WkHtmlToPdf static DLL)을 통해 하나의 파일을 PDF로 변환하면 3-5 분 정도 자면 안전하게 이동할 수 있습니다.
출력 PDF의 내부에는 2MB + 및 약 500 페이지가 있습니다.
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);
}
내 스톱워치 말 : 그들이 그렇게 오래 기다릴 때
Start: 00:00:00.0007693
TransformXMLToHTML done: 00:00:03.6661490
HtmlToPdf2 done: 00:03:50.7784590
WriteAllBytes done: 00:03:50.7871326
내 사용자가 울 것입니다.
예상되는 목표는 무엇입니까? –
원시 html을 컴퓨터의 wkhtmltopdf (http://wkhtmltopdf.org/) 명령 줄에 전달하여 비교 한 결과가 있습니까? 타이머로 이것을 감싸는 Powershell 스크립트를 작성할 수 있습니다. –
바쉬 - 데미안, 나는 약 1 분, 아마도 2 분 정도를 기대합니다. –