Skip to content

raphadesa/BlazorPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlazorPdf

Based on wkhtmltopdf.exe

Get it from nuget:

install-package BlazorPdf

Note: The executable wkhtmltopdf.exe is automatically copied to your local project upon first execution, and is saved under the Rotativa folder.

public class GeneratePdfController : Controller
    {
        [HttpGet]
        [Route("DownloadPdf")]
        public IActionResult DownloadPdf()
        {
            var pdfGenerator = new BlazorPdf.GeneratePdf("https://www.google.fr/");
            var pdf = pdfGenerator.getPdf();
            var pdfStream = new System.IO.MemoryStream(pdf);
            return new FileStreamResult(pdfStream"application/pdf");
        }
    }

About

Generate a PDF from a URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors