C# 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
IronPDFの詳細な機能概要をご覧ください。
IronPDFは必須のプラグインです。 今すぐ手に入れてIronPDFのNuGetパッケージで試してみましょう。
.NET C#でHTML文字列からPDFファイルを作成する
C#でHTML文字列からPDFファイルを生成することは、C#で新しいPDFファイルを作成する効率的でやりがいのある方法です。
IronPDF DLL に組み込まれた Google Chromium エンジンのバージョンにより、RenderHtmlAsPdf 関数は、任意の 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)
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")
参照されるすべての 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)
その結果として、生成された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)
この戦略の利点は、開発者が作成中にブラウザで HTML コンテンツをテストできることです。 IronPDF のレンダリングエンジンは Chrome ウェブブラウザを基盤としています。 したがって、XML から PDF 変換 を使用することが推奨されています。XML コンテンツを PDF に印刷することは、XSLT テンプレートを使用して行うことができます。
ASP.NET Web フォームを PDF ファイルに変換する
1行のコードで、ASP.NETオンラインフォームをHTMLの代わりにPDF形式に変換できます。 ページのコードビハインドファイルの Page_Load メソッドにコード行を配置して、ページに表示させます。
ASP.NET Web Formsアプリケーションは、ゼロから作成することも、以前のバージョンから開くこともできます。
まだインストールされていない場合は、NuGetパッケージをインストールしてください。
using キーワードを使用して IronPdf 名前空間をインポートする必要があります。
PDFに変換したいページのコードビハインドに移動します。 例えば、ASP.NETを使用する場合はファイル Default.aspx.cs です。
RenderThisPageAsPdf は AspxToPdf クラスのメソッドです。
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
これには、IronPdf.Extensions.ASPX NuGetパッケージをインストールする必要があります。 ASPXはMVCモデルに取って代わられているため、.NET Coreでは利用できません。
HTMLテンプレートを適用する
イントラネットおよびウェブサイトの開発者にとって、PDFをテンプレート化したり「一括生成」したりする機能は標準的な必要性です。
PDFドキュメントのテンプレートを作成するのではなく、IronPDFライブラリは、既存の十分にテストされた技術を活用してHTMLのテンプレートを生成する方法を提供します。
以下に示すように、HTMLテンプレートにクエリ文字列やデータベースからのデータを補完すると、動的に生成されるPDFファイルが作成されます。
例として、C#のStringクラスとそのプロパティを考えてみましょう。 Formatメソッドは、基本的な「メール差し込み」操作に適しています。
// 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")
HTMLファイルは非常に大きい場合があるため、任意のプレースホルダー、例えば[[NAME]]を使用し、それらを実際のデータと置き換えるのが一般的です。
次の例では、3つの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
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
ASP.NET MVCルーティング: このページのPDFバージョンをダウンロード
ASP.NET MVCフレームワークを使用すると、ユーザーをPDFファイルに誘導できます。
新しいASP.NET MVCアプリケーションを構築する場合、または既存のアプリケーションに既存のMVCコントローラーを追加する場合は、このオプションを選択します。 ドロップダウンメニューから ASP.NET Web Application (.NET Framework) > MVC を選択して、Visual Studioの新規プロジェクトウィザードを開始します。 あるいは、既存のMVCプロジェクトを開くこともできます。 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
PDFドキュメントに表紙ページを追加する
PDF ドキュメントに表紙ページを追加
IronPDFはPDFドキュメントの結合プロセスを簡素化します。 この技術の最も一般的な用途は、すでにレンダリングされたPDFドキュメントにカバーページまたは裏ページを追加することです。
これを達成するには、表紙ページを準備し、次に PdfDocument 機能を使用します。
2つのドキュメントを結合するには、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")
文書にウォーターマークを追加する
最後に、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")
あなたのPDFファイルはパスワードで保護できます
PDFドキュメントのパスワードプロパティを設定すると、暗号化され、ユーザーはドキュメントを読むために正しいパスワードを提供する必要があります。 この例は.NET Coreコンソールアプリケーションで使用できます。
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
上記の利点に加えて、IronPDFでは次のことも可能です:
PDFを作成することは非常に困難な取り組みです; 一部の人々は、最も優れたドキュメントを作成するために利用すべき基本概念に出会ったことがないかもしれません。
その結果、IronPDFは非常に役立ちます、それはPDFの作成を簡素化し、その結果、PDFおよびHTMLから作成されたドキュメントの元のプレゼンテーションを向上させます。
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を使用して、ファイルを暗号化するためにPdfDocumentのPasswordプロパティを設定することで、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プロジェクト間でシームレスに動作します。以前 for .NETバージョンと同様に、 RenderUrlAsPdfなどの使い慣れたメソッドや、MIMEタイプapplication/pdfでFileStreamResult返すメソッドも引き続き使用できます。IronPDFはクロスプラットフォーム対応として設計されており、.NET 10はサポート対象フレームワークに明示的に含まれています。([ironpdf.com](https://ironpdf.com/?utm_source=openai))




