how to use
- Download free package and add reference to the NReco.PdfGenerator.dll assembly OR install NReco.PdfGenerator nuget package
- 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);
- Create PDF from HTML file or URL (WebForms, MVC page):
htmlToPdf.GeneratePdfFromFile("http://www.nrecosite.com/", null, "export.pdf");
- That's all! See also online PdfGenerator API documentation.
No hay comentarios:
Publicar un comentario