Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# html to pdf

// PM > Install-Package NReco.PdfGenerator

Create HtmltoPdf(){
   if (System.IO.File.Exists("HTMLFile.html"))
    {
        System.IO.File.Delete("HTMLFile.html");
    }

    System.IO.File.WriteAllText("HTMLFile.html", html);
    var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
    if (System.IO.File.Exists("export.pdf"))
    {
        System.IO.File.Delete("export.pdf");
    }

    htmlToPdf.GeneratePdfFromFile("HTMLFile.html", null, "export.pdf");
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #html #pdf
ADD COMMENT
Topic
Name
2+6 =