Buscar contenidos

jueves, 22 de noviembre de 2018

HTML-to-PDF Generator for .NET C# WkHtmlToPdf wrapper

https://www.nrecosite.com/pdf_generator_net.aspx


how to use

  1. Download free package and add reference to the NReco.PdfGenerator.dll assembly OR install NReco.PdfGenerator nuget package 
  2. Convert HTML to PDF with C# code:
    var htmlContent = String.Format("<body>Hello world: {0}</body>", 
      DateTime.Now);
    var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
    var pdfBytes = htmlToPdf.GeneratePdf(htmlContent);
  3. Create PDF from HTML file or URL (WebForms, MVC page):
    htmlToPdf.GeneratePdfFromFile("http://www.nrecosite.com/", null, "export.pdf");
  4. That's all! See also online PdfGenerator API documentation.
Feel free to contact us in case of any questions.


No hay comentarios:

Publicar un comentario