Im working in a project which requires current html page to convert in pdf and that pdf will automatically save on button click on server and its reference will be save in da
In short:
HTML Renderer for PDF using PdfSharp
public static Byte[] PdfSharpConvert(String html)
{
Byte[] res = null;
using (MemoryStream ms = new MemoryStream())
{
var pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(html, PdfSharp.PageSize.A4);
pdf.Save(ms);
res = ms.ToArray();
}
return res;
}
More Detailed Answer