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 permitir la representación de vistas en archivos PDF. El paquete IronPdf.Extensions.Mvc.Core sirve como una extensión de IronPdf, lo que permite la representación de vistas en archivos PDF.

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 17,803,474 | Versión: 2026.3 recién lanzado
Still Scrolling Icon

¿Aún desplazándote?

¿Quieres una prueba rápida? PM > Install-Package IronPdf
ejecutar una muestra Mira cómo tu HTML se convierte en PDF.