CSHTML a PDF (MVC Core)

Este ejemplo de código demuestra el proceso de convertir Vistas en PDFs.

Dos paquetes, IronPdf.Extensions.Mvc.Core y IronPdf, trabajan juntos para habilitar la renderización de Vistas en PDFs. El paquete IronPdf.Extensions.Mvc.Core sirve como una extensión de IronPdf, permitiendo la renderización de Vistas en PDFs.

Use the RenderRazorViewToPdf method to render Views to PDFs. This method requires an IRazorViewRenderer, the path to the ".cshtml" file, and the data required to display on the ".cshtml" file. Please visit the How to Convert View to PDF in ASP.NET Core MVC how-to article to learn more.

This action also enables you to access the full range of features provided by the RenderingOptions class, such as applying page numbers in PDFs with IronPDF, adding text and HTML headers and footers with IronPDF, and customizing PDF paper size. The resulting PDF document can be further edited or exported as needed.

Aprenda a convertir vistas CSHTML a PDF en ASP.NET MVC Core.

¿Listo para empezar?
Nuget Descargas 16,685,821 | Versión: 2025.12 recién lanzado