Skip to content

This repository contains code that demonstrates how to use Syncfusion's HTML to PDF Conversion library to convert HTML files to PDF documents in an ASP.NET Core application.

Notifications You must be signed in to change notification settings

SyncfusionExamples/html-to-pdf-converter-aspnet-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Convert HTML to PDF in ASP.NET Core application

Introduction

The Syncfusion HTML to PDF converter is a .NET library used to convert HTML or web pages to PDF document in ASP.NET Core application.

System requirement

Framework and SDKs:

  • .NET Core SDK (version 3.1 or later)

IDEs:

  • Visual Studio 2019/ Visual Studio 2022

Code snippet to convert HTML to PDF

we will create a existing ASP.Net Core application, add the Syncfusion HTML to PDF library package, and write the code

    HtmlToPdfConverter converter = new HtmlToPdfConverter();
    BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
    blinkConverterSettings.ViewPortSize = new Syncfusion.Drawing.Size(800, 0);
    converter.ConverterSettings = blinkConverterSettings;
    using (PdfDocument document = converter.Convert("https://localhost:7156/Home/Invoice"))
    {
        MemoryStream stream = new MemoryStream();
        document.Save(stream);
        stream.Position = 0;
        return File(stream, "application/pdf", "HTML-to-PDF.pdf");
    }

Output Image output_image

How to run the examples

  • Download this project to a location in your disk.
  • Open the solution file using Visual Studio.
  • Rebuild the solution to install the required NuGet package.
  • Run the application.

Resources

Support and feedback

License

This is a commercial product and requires a paid license for possession or use. Syncfusion’s licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a licnense here or start a free 30-day trial here.

About Syncfusion

Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 29,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.

Today, we provide 1800+ components and frameworks for web (Blazor, ASP.NET Core, ASP.NET MVC, ASP.NET WebForms, JavaScript, Angular, React, Vue, and Flutter), mobile (Xamarin, Flutter, UWP, and JavaScript), and desktop development (WinForms, WPF, WinUI(Preview), Flutter and UWP). We provide ready-to-deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.

About

This repository contains code that demonstrates how to use Syncfusion's HTML to PDF Conversion library to convert HTML files to PDF documents in an ASP.NET Core application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published