This content originally appeared on DEV Community and was authored by Satish Patil
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);
This content originally appeared on DEV Community and was authored by Satish Patil
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.
APA
MLA
Satish Patil | Sciencx (2021-09-27T05:28:17+00:00) HTMLtoPdf – Converts HTML content to PDF using chrome executable. Retrieved from https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/
" » HTMLtoPdf – Converts HTML content to PDF using chrome executable." Satish Patil | Sciencx - Monday September 27, 2021, https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/
HARVARDSatish Patil | Sciencx Monday September 27, 2021 » HTMLtoPdf – Converts HTML content to PDF using chrome executable., viewed ,<https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/>
VANCOUVERSatish Patil | Sciencx - » HTMLtoPdf – Converts HTML content to PDF using chrome executable. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/
CHICAGO" » HTMLtoPdf – Converts HTML content to PDF using chrome executable." Satish Patil | Sciencx - Accessed . https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/
IEEE" » HTMLtoPdf – Converts HTML content to PDF using chrome executable." Satish Patil | Sciencx [Online]. Available: https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/. [Accessed: ]
rf:citation » HTMLtoPdf – Converts HTML content to PDF using chrome executable | Satish Patil | Sciencx | https://www.scien.cx/2021/09/27/htmltopdf-converts-html-content-to-pdf-using-chrome-executable/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.