CSHTMLからPDFへ(MVC Core)

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

2 つのパッケージ IronPdf.Extensions.Mvc.CoreIronPdf が連携して動作し、ビューを PDF にレンダリングできるようになります。 IronPdf.Extensions.Mvc.Core パッケージは、IronPdf の拡張機能として機能し、ビューを 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 ダウンロード 17,803,474 | バージョン: 2026.3 リリース
Still Scrolling Icon

まだスクロールしていますか?

すぐに証拠が欲しいですか? PM > Install-Package IronPdf
サンプルを実行するHTML が PDF に変換されるのを確認します。