DEV Community

Satish Patil
Satish Patil

Posted on

2

HTMLtoPdf for .net core 3.1 - Converts HTML content to PDF using chrome executable

Note : Requires Chrome executable
Nuget Link -https://www.nuget.org/packages/Sats.Core.HTMLToPdf

          var url = @"d:\test.html";
          var chromePath = @"C:\Program Files\Google\Chrome\Application\chrome.exe";

    var output = new ChromeOptions().AddOptions(b =>
                        {
                            b.Headless();
                            b.DisableGPU();
                            b.WithoutHeader();

                        }).ToPdf(new ChromeDetails()
                        {
                            ChromePath = chromePath,
                            HtmlPath = url,
                            DeleteOutputFile = true, //optional
                           // OutputPath = @"d:\print.pdf" // (add if Environment.CurrentDirectory does not have access rights)
                        });


    File.WriteAllBytes(@"d:\print.pdf", output.FileDetails.File);
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more