IronPdf.Extensions.Mvc.Framework
2024.5.2
Prefix Reserved
dotnet add package IronPdf.Extensions.Mvc.Framework --version 2024.5.2
NuGet\Install-Package IronPdf.Extensions.Mvc.Framework -Version 2024.5.2
<PackageReference Include="IronPdf.Extensions.Mvc.Framework" Version="2024.5.2" />
paket add IronPdf.Extensions.Mvc.Framework --version 2024.5.2
#r "nuget: IronPdf.Extensions.Mvc.Framework, 2024.5.2"
// Install IronPdf.Extensions.Mvc.Framework as a Cake Addin #addin nuget:?package=IronPdf.Extensions.Mvc.Framework&version=2024.5.2 // Install IronPdf.Extensions.Mvc.Framework as a Cake Tool #tool nuget:?package=IronPdf.Extensions.Mvc.Framework&version=2024.5.2
IronPdf Extensions Package for MVC .NET Framework
Compatibility
Supports web applications and websites developed with MVC design pattern in .NET FrameWork 4.6.2 (and above) for Windows and Azure.
The IronPDF MVC .NET Framework extension provides MVC utility methods such as RenderView
that convert Views to PDF documents and requires the main IronPdf package.
Please visit "How to Convert Views to PDFs in ASP.NET MVC" for a comprehensive guide on how to use the package.
C# Code Example
using AutoFixture;
using System.Collections.Generic;
using System.Web.Mvc;
using WebApplication4.Models;
namespace IronPdf.Web.MVC.Extension.Poc.Controllers
{
public class PersonController : Controller
{
// GET: Person
public ActionResult Persons()
{
var persons = new List<Person>();
for (int i = 0; i < 100; i++)
{
var _fixture = new Fixture();
var person = _fixture.Build<Person>().Create();
persons.Add(person);
}
if (HttpContext.Request.HttpMethod == "POST")
{
var controllerContext = this.HttpContext;
var viewPath = "~/Views/Person/Persons.cshtml"; // Provide the path to your view file
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderView(this.HttpContext, viewPath, persons);
Response.Headers.Add("Content-Disposition", "inline");
return File(pdf.BinaryData, "application/pdf");
}
return View(persons);
}
}
}
Note: This package installs only as an extension, and you also need to install the IronPDF package to use it in your application.
Documentation
- Code Samples : https://ironpdf.com/examples/cshtml-to-pdf-mvc-framework/
- How-to : https://ironpdf.com/how-to/cshtml-to-pdf-mvc-framework/
- MSDN Class Reference : https://ironpdf.com/c%23-pdf-documentation/
- Licensing : https://ironpdf.com/licensing/
- Live Chat Support : https://ironpdf.com/#helpscout-support
For more support and inquiries, please email us at: support@ironsoftware.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Minor Bug Fixes