CSHTMLからPDFへ(MVC Core)

このコード例は、Views を PDF に変換するプロセスを示しています。

2 つのパッケージ、IronPdf.Extensions.Mvc.CoreIronPdf が連携して、Views の PDF へのレンダリングを可能にします。 IronPdf.Extensions.Mvc.Core パッケージは、IronPdfへの拡張機能として機能し、Views の 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.

ASP.NET MVC CoreでCSHTMLビューをPDFに変換する方法を学んでください。

準備はできましたか?
Nuget ダウンロード 16,685,821 | バージョン: 2025.12 リリース