An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
September 27, 2021 05:28 am GMT
Original Link: https://dev.to/satsvelke/htmltopdf-converts-html-content-to-pdf-using-chrome-executable-3lmf
HTMLtoPdf - Converts HTML content to PDF using chrome executable
Note : Requires Chrome executable
Nuget Link - https://www.nuget.org/packages/Sats.HTMLtoPdf
Github link - https://github.com/satsvelke/HTMLtoPdf
Usage
var url = @"d:\Vaccination.html"; var chromePath = @"C:\Program Files\Google\Chrome\Application\chrome.exe"; // returns byte array of file var pdf = new ChromeOptions().AddOptions(b => { b.Headless(); b.DisableGPU(); b.WithoutHeader(); }).Pdf(new ChromeDetails() { ChromePath = chromePath, HtmlPath = url }); File.WriteAllBytes(@"d:\print.pdf", pdf);
Original Link: https://dev.to/satsvelke/htmltopdf-converts-html-content-to-pdf-using-chrome-executable-3lmf
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To