- Code: Select all
string htmlCode = File.ReadAllText("C:\\Users..\\myproject\\Template.html");
string outputFile = "C:\\New folder\\output.pdf";
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.PluginPath = "C:\\Users\\..\\myproject\\bin";
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(htmlCode ,
outputFile,
//enable javascript
true,
//load timeout
10 * 1000,
//page size
new SizeF(612, 792),
//page margins
new Spire.Pdf.Graphics.PdfMargins(0),
//load from content type
LoadHtmlType.SourceCode
);