IronPdf.Extensions.Mvc.Framework 2024.2.18

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package IronPdf.Extensions.Mvc.Framework --version 2024.2.18                
NuGet\Install-Package IronPdf.Extensions.Mvc.Framework -Version 2024.2.18                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IronPdf.Extensions.Mvc.Framework" Version="2024.2.18" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IronPdf.Extensions.Mvc.Framework --version 2024.2.18                
#r "nuget: IronPdf.Extensions.Mvc.Framework, 2024.2.18"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IronPdf.Extensions.Mvc.Framework as a Cake Addin
#addin nuget:?package=IronPdf.Extensions.Mvc.Framework&version=2024.2.18

// Install IronPdf.Extensions.Mvc.Framework as a Cake Tool
#tool nuget:?package=IronPdf.Extensions.Mvc.Framework&version=2024.2.18                

Nuget Installs windows microsoftazure livechat

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

For more support and inquiries, please email us at: support@ironsoftware.com

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
2024.5.2 224 5/17/2024
2024.2.18 226 1/29/2024
2023.9.1 441 9/16/2023

* Update the package description.
* Add the method to convert Razor View to HTML (see RenderViewToHtml).