CSHTML zu PDF (MVC Core)

Dieses Codebeispiel demonstriert den Prozess der Umwandlung von Ansichten in PDFs.

Zwei Pakete, IronPdf.Extensions.Mvc.Core und IronPdf, arbeiten zusammen, um das Rendern von Ansichten in PDFs zu ermöglichen. Das Paket IronPdf.Extensions.Mvc.Core dient als Erweiterung zu IronPdf und ermöglicht das Rendern von Ansichten zu 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.

Lernen Sie, wie man CSHTML-Ansichten in ASP.NET MVC Core in PDFs konvertiert.

Bereit anzufangen?
Nuget Downloads 16,685,821 | Version: 2025.12 gerade veröffentlicht