フッターコンテンツにスキップ
IRONPDFの使用

C#およびIronPDFを使用してASP.NETでPDFファイルを表示する方法

ほとんどの人は専用のデスクトップアプリケーションを使用してコンピュータでPDFを開きますが、ソフトウェアエンジニアはIronPDFを使用してC#でPDFコンテンツをプログラム的に作成、表示、開く、読む、編集することができます。

IronPDFはASP.NETとC#でPDFファイルを読むときに非常に便利なプラグインです。

ASP.NET PDFデモプロジェクトをダウンロードできます。

C#とIronPDFを使用してPDFドキュメントを迅速かつ簡単に作成することができます。

PDFドキュメントのデザインとレイアウトの多くは、既存のHTMLアセットを使用するか、ウェブデザインの担当者に業務を委任することで達成できます。 アプリケーションへのPDF生成の統合という時間のかかる作業を処理し、準備されたドキュメントのPDFへの自動変換を行います。 .NETでは、次のことが可能です:

  • ウェブフォーム、ローカルHTMLページ、その他のウェブサイトをPDF形式に変換します。
  • ドキュメントをダウンロード、他者とメールで共有、またはクラウドに保存できるようにします。
  • 顧客に請求書を発行し、見積もりを提供します; レポートを準備します。 契約書やその他の書類に関して交渉します。
  • ASP.NET、ASP.NET Core、Webフォーム、MVC、Web APIを.NET Frameworkおよび.NET Core、および他のプログラミング言語で使用します。

IronPDFライブラリのセットアップ

ライブラリをインストールするには2つの方法があります。

NuGetパッケージマネージャーでインストールする

IronPDFはVisual StudioアドインまたはコマンドラインからNuGetパッケージマネージャーでインストールできます。コンソールに移動し、以下のコマンドをVisual Studioに入力してください:

Install-Package IronPdf

DLLファイルをウェブサイトから直接ダウンロードする

または、DLLをウェブサイトから直接取得できます。

IronPDFを使用するすべてのcsクラスファイルの先頭に次の指令を必ず含めてください:

using IronPdf;
using IronPdf;
Imports IronPdf
$vbLabelText   $csharpLabel

IronPDFの詳細な機能概要をご覧ください。

IronPDFは必須のプラグインです。 今すぐ手に入れてIronPDFのNuGetパッケージで試してみましょう

.NET C#でHTML文字列からPDFファイルを生成する

C#でHTML文字列からPDFファイルを生成することは、C#で新しいPDFファイルを作成する効率的でやりがいのある方法です。

RenderHtmlAsPdf関数はChromePdfRendererから提供されており、IronPDF DLLに組み込まれたGoogle Chromiumエンジンのおかげで、任意のHTML(HTML5)文字列を簡単にPDFドキュメントに変換する方法を提供します。

// Create a renderer to convert HTML to PDF
var renderer = new ChromePdfRenderer();

// Convert an HTML string to a PDF
using var renderedPdf = renderer.RenderHtmlAsPdf("<h1>My First HTML to Pdf</h1>");

// Define the output path for the PDF
var outputPath = "My_First_Html.pdf";

// Save the rendered PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Automatically open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
// Create a renderer to convert HTML to PDF
var renderer = new ChromePdfRenderer();

// Convert an HTML string to a PDF
using var renderedPdf = renderer.RenderHtmlAsPdf("<h1>My First HTML to Pdf</h1>");

// Define the output path for the PDF
var outputPath = "My_First_Html.pdf";

// Save the rendered PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Automatically open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
' Create a renderer to convert HTML to PDF
Dim renderer = New ChromePdfRenderer()

' Convert an HTML string to a PDF
Dim renderedPdf = renderer.RenderHtmlAsPdf("<h1>My First HTML to Pdf</h1>")

' Define the output path for the PDF
Dim outputPath = "My_First_Html.pdf"

' Save the rendered PDF to the specified path
renderedPdf.SaveAs(outputPath)

' Automatically open the newly created PDF
System.Diagnostics.Process.Start(outputPath)
$vbLabelText   $csharpLabel

RenderHtmlAsPdfは、CSS、JavaScript、および画像をすべてサポートする強力なツールです。 これらの資料がハードディスクに保存されている場合は、RenderHtmlAsPdf の 2 番目の引数を設定する必要があるかもしれません。

以下のコードはPDFファイルを生成します:

// Render HTML to PDF with a base path for local assets
var renderPdf = renderer.RenderHtmlAsPdf("<img src='image_1.png'/>", @"C:\Newproject");
// Render HTML to PDF with a base path for local assets
var renderPdf = renderer.RenderHtmlAsPdf("<img src='image_1.png'/>", @"C:\Newproject");
' Render HTML to PDF with a base path for local assets
Dim renderPdf = renderer.RenderHtmlAsPdf("<img src='image_1.png'/>", "C:\Newproject")
$vbLabelText   $csharpLabel

参照されたすべてのCSSスタイルシート、画像、JavaScriptファイルはBaseUrlPathを基準にして相対的に扱われ、より整然かな構造が維持されるようになります。 たとえば、Webフォント、Googleフォント、さらにはjQueryなど、インターネットで利用可能な画像、スタイルシート、資産をもちろん使用することもできます。

既存のHTML URLを使用してPDFドキュメントを作成する

既存のURLをC#で効率的にPDFにレンダリングできます。 これにより、PDFデザインとバックエンドPDFレンダリング作業をさまざまなセクションに分けることができるため、チームにとって有益です。

以下のコードは、endeavorcreative.comページをそのURLからレンダリングする方法を示しています:

// Create a renderer for converting URLs to PDF
var renderer = new ChromePdfRenderer();

// Convert the specified URL to a PDF
using var renderedPdf = renderer.RenderUrlAsPdf("https://endeavorcreative.com/setting-up-wordpress-website-from-scratch/");

// Specify the output path for the PDF
var outputPath = "Url_pdf.pdf";

// Save the PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
// Create a renderer for converting URLs to PDF
var renderer = new ChromePdfRenderer();

// Convert the specified URL to a PDF
using var renderedPdf = renderer.RenderUrlAsPdf("https://endeavorcreative.com/setting-up-wordpress-website-from-scratch/");

// Specify the output path for the PDF
var outputPath = "Url_pdf.pdf";

// Save the PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
' Create a renderer for converting URLs to PDF
Dim renderer = New ChromePdfRenderer()

' Convert the specified URL to a PDF
Dim renderedPdf = renderer.RenderUrlAsPdf("https://endeavorcreative.com/setting-up-wordpress-website-from-scratch/")

' Specify the output path for the PDF
Dim outputPath = "Url_pdf.pdf"

' Save the PDF to the specified path
renderedPdf.SaveAs(outputPath)

' Open the newly created PDF
System.Diagnostics.Process.Start(outputPath)
$vbLabelText   $csharpLabel

その結果として、生成されたPDFにはすべてのハイパーリンク(HTMLリンク)およびHTMLフォームが保持されます。

既存のHTMLドキュメントからPDFドキュメントを作成する

このセクションでは、任意のローカルHTMLファイルをレンダリングする方法を示します。ファイルは、CSS、画像、JavaScriptなどのすべての相対資産に対してfile:/プロトコルを使用して開かれたように表示されます。

// Create a renderer for existing HTML files
var renderer = new ChromePdfRenderer();

// Render an HTML file to PDF
using var renderedPdf = renderer.RenderHtmlFileAsPdf("Assets/test1.html");

// Specify the output path for the PDF
var outputPath = "test1_pdf.pdf";

// Save the PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
// Create a renderer for existing HTML files
var renderer = new ChromePdfRenderer();

// Render an HTML file to PDF
using var renderedPdf = renderer.RenderHtmlFileAsPdf("Assets/test1.html");

// Specify the output path for the PDF
var outputPath = "test1_pdf.pdf";

// Save the PDF to the specified path
renderedPdf.SaveAs(outputPath);

// Open the newly created PDF
System.Diagnostics.Process.Start(outputPath);
' Create a renderer for existing HTML files
Dim renderer = New ChromePdfRenderer()

' Render an HTML file to PDF
Dim renderedPdf = renderer.RenderHtmlFileAsPdf("Assets/test1.html")

' Specify the output path for the PDF
Dim outputPath = "test1_pdf.pdf"

' Save the PDF to the specified path
renderedPdf.SaveAs(outputPath)

' Open the newly created PDF
System.Diagnostics.Process.Start(outputPath)
$vbLabelText   $csharpLabel

この戦略の利点は、開発者が作成中にブラウザで HTML コンテンツをテストできることです。 IronPDF のレンダリングエンジンは Chrome ウェブブラウザを基盤としています。 したがって、XML から PDF 変換 を使用することが推奨されています。XML コンテンツを PDF に印刷することは、XSLT テンプレートを使用して行うことができます。

ASP.NET Web フォームを PDF ファイルに変換する

With a single line of code, you can convert ASP.NET online forms to PDF format instead of HTML. Place the line of code in the Page_Load method of the page's code-behind file to make it appear on the page.

ASP.NET Web Forms Applications can either be created from scratch or opened from a previous version.

Install the NuGet package if it is not already installed.

The using keyword should be used to import the IronPdf namespace.

Navigate to the code behind the page that you'd like to convert to PDF. For instance, the file Default.aspx.cs using ASP.NET.

RenderThisPageAsPdfAspxToPdfクラスのメソッドです。

using IronPdf;
using System;
using System.Web.UI;

namespace WebApplication7
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Render the current page as a PDF in the browser
            AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.InBrowser);
        }
    }
}
using IronPdf;
using System;
using System.Web.UI;

namespace WebApplication7
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Render the current page as a PDF in the browser
            AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.InBrowser);
        }
    }
}
Imports IronPdf
Imports System
Imports System.Web.UI

Namespace WebApplication7
	Partial Public Class _Default
		Inherits Page

		Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
			' Render the current page as a PDF in the browser
			AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.InBrowser)
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

これには、IronPDF.Extensions.ASPX NuGetパッケージをインストールする必要があります。 IronPDF.Extensions.ASPX NuGetパッケージをインストールする必要があります。

Apply HTML Templating

For Intranet and website developers, the ability to template or "batch produce" PDFs is a standard necessity.

Rather than creating a template for a PDF document, the IronPDF Library offers a way to generate a template for HTML by leveraging existing, well-tested technology.

A dynamically generated PDF file is created when the HTML template is supplemented with data from a query string or a database, as shown below.

As an example, consider the C# String class and its properties. The Format method works well for basic "mail-merge" operations.

// Basic HTML String Formatting
string formattedString = String.Format("<h1>Hello {0}!</h1>", "World");
// Basic HTML String Formatting
string formattedString = String.Format("<h1>Hello {0}!</h1>", "World");
' Basic HTML String Formatting
Dim formattedString As String = String.Format("<h1>Hello {0}!</h1>", "World")
$vbLabelText   $csharpLabel

Because HTML files can be pretty extensive, it is common to utilize arbitrary placeholders, such as [[NAME]], and then replace them with the actual data.

HTMLファイルは非常に大きい場合があるため、任意のプレースホルダー、例えば[[NAME]]を使用し、それらを実際のデータと置き換えるのが一般的です。

// Define an HTML template with a placeholder
var htmlTemplate = "<p>[[NAME]]</p>";

// Sample data to replace placeholders
var names = new[] { "John", "James", "Jenny" };

// Create a new PDF for each name
foreach (var name in names)
{
    // Replace placeholder with actual name
    var htmlInstance = htmlTemplate.Replace("[[NAME]]", name);

    // Create a renderer and render the HTML as PDF
    var renderer = new ChromePdfRenderer();
    using var pdf = renderer.RenderHtmlAsPdf(htmlInstance);

    // Save the PDF with the name in the filename
    pdf.SaveAs($"{name}.pdf");
}
// Define an HTML template with a placeholder
var htmlTemplate = "<p>[[NAME]]</p>";

// Sample data to replace placeholders
var names = new[] { "John", "James", "Jenny" };

// Create a new PDF for each name
foreach (var name in names)
{
    // Replace placeholder with actual name
    var htmlInstance = htmlTemplate.Replace("[[NAME]]", name);

    // Create a renderer and render the HTML as PDF
    var renderer = new ChromePdfRenderer();
    using var pdf = renderer.RenderHtmlAsPdf(htmlInstance);

    // Save the PDF with the name in the filename
    pdf.SaveAs($"{name}.pdf");
}
' Define an HTML template with a placeholder
Dim htmlTemplate = "<p>[[NAME]]</p>"

' Sample data to replace placeholders
Dim names = { "John", "James", "Jenny" }

' Create a new PDF for each name
For Each name In names
	' Replace placeholder with actual name
	Dim htmlInstance = htmlTemplate.Replace("[[NAME]]", name)

	' Create a renderer and render the HTML as PDF
	Dim renderer = New ChromePdfRenderer()
	Dim pdf = renderer.RenderHtmlAsPdf(htmlInstance)

	' Save the PDF with the name in the filename
	pdf.SaveAs($"{name}.pdf")
Next name
$vbLabelText   $csharpLabel

ASP.NET MVCルーティング: このページのPDFバージョンをダウンロード

ASP.NET MVCルーティング: このページのPDF版をダウンロードする

新しいASP.NET MVCアプリケーションを構築するか、既存のアプリケーションに既存のMVCコントローラーを追加する場合は、このオプションを選択します。 新しいASP.NET MVCアプリケーションを作成する際、または既存のMVCコントローラーを既存のアプリケーションに追加する際にこのオプションを選択します。 あるいは、既存のMVCプロジェクトを開くこともできます。 Controllersフォルダ内のHomeControllerファイルのIndexメソッドを置き換えるか、Controllersフォルダに新しいコントローラーを作成します。

ControllersフォルダーのHomeControllerファイルのIndexメソッドを置き換えるか、またはControllersフォルダーに新しいコントローラーを作成します。

using IronPdf;
using System;
using System.Web.Mvc;

namespace WebApplication8.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            // Render a URL as PDF and return it in the response
            using var pdf = HtmlToPdf.StaticRenderUrlAsPdf(new Uri("https://en.wikipedia.org"));
            return File(pdf.BinaryData, "application/pdf", "Wiki.Pdf");
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";
            return View();
        }
    }
}
using IronPdf;
using System;
using System.Web.Mvc;

namespace WebApplication8.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            // Render a URL as PDF and return it in the response
            using var pdf = HtmlToPdf.StaticRenderUrlAsPdf(new Uri("https://en.wikipedia.org"));
            return File(pdf.BinaryData, "application/pdf", "Wiki.Pdf");
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";
            return View();
        }
    }
}
Imports IronPdf
Imports System
Imports System.Web.Mvc

Namespace WebApplication8.Controllers
	Public Class HomeController
		Inherits Controller

		Public Function Index() As ActionResult
			' Render a URL as PDF and return it in the response
			Dim pdf = HtmlToPdf.StaticRenderUrlAsPdf(New Uri("https://en.wikipedia.org"))
			Return File(pdf.BinaryData, "application/pdf", "Wiki.Pdf")
		End Function

		Public Function About() As ActionResult
			ViewBag.Message = "Your application description page."
			Return View()
		End Function

		Public Function Contact() As ActionResult
			ViewBag.Message = "Your contact page."
			Return View()
		End Function
	End Class
End Namespace
$vbLabelText   $csharpLabel

コードがどのように書かれるべきかの例は以下のとおりです:

C#とIronPDFを使用してASP.NETでPDFファイルを表示する方法、図1:PDFドキュメントにカバーページを追加 PDFドキュメントにカバーページを追加

IronPDFはPDFドキュメントの結合プロセスを簡素化します。 この技術の最も一般的な用途は、すでにレンダリングされたPDFドキュメントにカバーページまたは裏ページを追加することです。

これを実現するために、表紙ページを準備した後、PdfDocument機能を使用します。

To combine the two documents, use the Merge PDF Documents Method.

// Create a renderer and render a PDF from a URL
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");

// Merge the cover page with the rendered PDF
using var merged = PdfDocument.Merge(new PdfDocument("CoverPage.pdf"), pdf);

// Save the merged document
merged.SaveAs("Combined.Pdf");
// Create a renderer and render a PDF from a URL
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/");

// Merge the cover page with the rendered PDF
using var merged = PdfDocument.Merge(new PdfDocument("CoverPage.pdf"), pdf);

// Save the merged document
merged.SaveAs("Combined.Pdf");
' Create a renderer and render a PDF from a URL
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf/")

' Merge the cover page with the rendered PDF
Dim merged = PdfDocument.Merge(New PdfDocument("CoverPage.pdf"), pdf)

' Save the merged document
merged.SaveAs("Combined.Pdf")
$vbLabelText   $csharpLabel

文書にウォーターマークを追加する

最後に、PDFドキュメントに透かしを追加するにはC#コードを使用できます; これを使用して、文書の各ページに"機密"または"サンプル"という免責事項を追加できます。

// Prepare a stamper with HTML content for the watermark
HtmlStamper stamper = new HtmlStamper("<h2 style='color:red'>SAMPLE</h2>")
{
    HorizontalOffset = new Length(-3, MeasurementUnit.Inch),
    VerticalAlignment = VerticalAlignment.Bottom
};

// Create a renderer and render a PDF from a URL
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

// Apply the watermark to the PDF
pdf.ApplyStamp(stamper);

// Save the watermarked PDF
pdf.SaveAs(@"C:\PathToWatermarked.pdf");
// Prepare a stamper with HTML content for the watermark
HtmlStamper stamper = new HtmlStamper("<h2 style='color:red'>SAMPLE</h2>")
{
    HorizontalOffset = new Length(-3, MeasurementUnit.Inch),
    VerticalAlignment = VerticalAlignment.Bottom
};

// Create a renderer and render a PDF from a URL
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

// Apply the watermark to the PDF
pdf.ApplyStamp(stamper);

// Save the watermarked PDF
pdf.SaveAs(@"C:\PathToWatermarked.pdf");
' Prepare a stamper with HTML content for the watermark
Dim stamper As New HtmlStamper("<h2 style='color:red'>SAMPLE</h2>") With {
	.HorizontalOffset = New Length(-3, MeasurementUnit.Inch),
	.VerticalAlignment = VerticalAlignment.Bottom
}

' Create a renderer and render a PDF from a URL
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")

' Apply the watermark to the PDF
pdf.ApplyStamp(stamper)

' Save the watermarked PDF
pdf.SaveAs("C:\PathToWatermarked.pdf")
$vbLabelText   $csharpLabel

あなたのPDFファイルはパスワードで保護できます

あなたのPDFファイルはパスワードで保護することができます PDF書類のパスワードプロパティを設定すると、暗号化され、ユーザーは書類を読むために正しいパスワードを提供する必要があります。

using IronPdf;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a renderer and render a PDF from HTML
            var renderer = new ChromePdfRenderer();
            using var pdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");

            // Set password to protect the PDF
            pdfDocument.Password = "strong!@#pass&^%word";

            // Save the secured PDF
            pdfDocument.SaveAs("secured.pdf");
        }
    }
}
using IronPdf;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create a renderer and render a PDF from HTML
            var renderer = new ChromePdfRenderer();
            using var pdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");

            // Set password to protect the PDF
            pdfDocument.Password = "strong!@#pass&^%word";

            // Save the secured PDF
            pdfDocument.SaveAs("secured.pdf");
        }
    }
}
Imports IronPdf

Namespace ConsoleApp
	Friend Class Program
		Shared Sub Main(ByVal args() As String)
			' Create a renderer and render a PDF from HTML
			Dim renderer = New ChromePdfRenderer()
			Dim pdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")

			' Set password to protect the PDF
			pdfDocument.Password = "strong!@#pass&^%word"

			' Save the secured PDF
			pdfDocument.SaveAs("secured.pdf")
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

この例は.NET Coreコンソールアプリケーションで使用できます。

その結果、IronPDFは非常に役立ちます、それはPDFの作成を簡素化し、その結果、PDFおよびHTMLから作成されたドキュメントの元のプレゼンテーションを向上させます。

C#とIronPDFを使用してASP.NETでPDFファイルを表示する方法、図2: C#とIronPDFを使用してASP.NETでPDFファイルを表示する方法 C#とIronPDFを使用してASP.NETでPDFファイルを表示する方法

IronPDFは必須の.NETライブラリです。 今すぐ手に入れてIronPDFのNuGetパッケージで試してみましょう

よくある質問

C#を使用してASP.NETアプリケーションでPDFファイルを表示するにはどうすればいいですか?

PDFを画像またはウェブページ内に埋め込めるHTML要素としてレンダリングすることで、ASP.NETアプリケーションでIronPDFを使用してPDFファイルを表示することができます。

ASP.NETでHTMLページをPDFに変換するためのステップは何ですか?

ASP.NETでHTMLページをPDFに変換するには、IronPDFのRenderHtmlAsPdfメソッドを使用できます。このメソッドは正確なレンダリングのためにCSSとJavaScriptをサポートしています。

C#で複数のPDF文書を結合するにはどうすればいいですか?

IronPDFは、異なるPDFファイルを単一の文書に結合するPdfDocument.Mergeメソッドを使用して、複数のPDF文書を結合することができます。

ASP.NETでPDF文書に透かしを追加することは可能ですか?

はい、IronPDFを使用してASP.NETでPDF文書に透かしを追加することができます。HtmlStamperクラスを使用してカスタムHTMLコンテンツをオーバーレイします。

C#を使ってPDFファイルにパスワード保護を実装するにはどうすればいいですか?

IronPDFを使用して、ファイルを暗号化するためにPdfDocumentPasswordプロパティを設定することで、PDFファイルにパスワード保護を実装することができます。

IronPDFを使用してASP.NET WebフォームをPDFに変換することはできますか?

はい、IronPDFはRenderThisPageAsPdfメソッドのようなメソッドを使用してASP.NET WebフォームをPDFに変換し、Webフォーム全体をPDF文書としてキャプチャします。

ASP.NETでのPDF生成においてIronPDFが提供する利点は何ですか?

IronPDFは、組み込みのGoogle Chromiumエンジンを使用してHTML、CSS、JavaScriptを正確にレンダリングするなど、ASP.NETでのPDF生成における柔軟なツールです。

ASP.NETプロジェクトにIronPDFをインストールするにはどうすればいいですか?

IronPDFは、NuGetパッケージマネージャーを使用するか、IronPDFウェブサイトからDLLファイルを直接ダウンロードすることでASP.NETプロジェクトにインストールできます。

IronPDFがソフトウェア開発者にとって貴重な資産である理由は何ですか?

IronPDFは複雑なPDF生成タスクを簡素化し、ASP.NETアプリケーションでの効率的なPDF操作を可能にすることで、ソフトウェア開発者にとって貴重な資産です。

C#でIronPDFを使用してURLからPDFを作成するにはどうすればいいですか?

IronPDF のRenderUrlAsPdfメソッドを使用して C# で URL から PDF を作成できます。このメソッドは URL からコンテンツを取得し、それを PDF ドキュメントに変換します。

.NET 10 サポート: IronPDF は、ASP.NET で PDF ファイルを表示するために .NET 10 と互換性がありますか?

はい。IronPDFは、ASP.NETまたはASP.NET Coreを使用したWebアプリケーションを含む、.NET 10を完全にサポートしています。特別な設定を必要とせず、.NET 10プロジェクト間でシームレスに動作します。以前の.NETバージョンと同様に、 RenderUrlAsPdfなどの使い慣れたメソッドや、MIMEタイプapplication/pdfFileStreamResult返すメソッドも引き続き使用できます。IronPDFはクロスプラットフォーム対応として設計されており、.NET 10はサポート対象フレームワークに明示的に含まれています。([ironpdf.com](https://ironpdf.com/?utm_source=openai))

カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。