Jak wyświetlać pliki PDF w ASP.NET korzystając z C# i IronPDF
Most people open PDFs on a computer using a dedicated desktop application, but software engineers can also use IronPDF to create, view, open, read, and edit PDF content with C# programmatically.
IronPDF turned out to be a very useful plugin when reading PDF files in ASP.NET and C#.
You can download the ASP.NET PDF demonstration project.
It is possible to create PDF documents quickly and easily using C# with IronPDF.
Much of the design and layout of PDF documents can be accomplished by using existing HTML assets or by delegating the task to web design employees; it takes care of the time-consuming task of integrating PDF generation into your application, and it automates converting prepared documents into PDFs. With .NET, you can:
- Convert web forms, local HTML pages, and other websites to PDF format.
- Allow users to download documents, share them with others via email, or save them in the cloud.
- Invoice customers and provide quotations; prepare reports; negotiate contracts and other paperwork.
- Work with ASP.NET, ASP.NET Core, Web Forms, MVC, Web APIs on .NET Framework and .NET Core, and other programming languages.
Setting up IronPDF Library
There are two ways to install the library;
Installing with the NuGet Package Manager
IronPDF can be installed via the Visual Studio Add-in or the NuGet Package Manager from the command line. Navigate to the Console, type in the following command in Visual Studio:
Install-Package IronPdf
Download the DLL File Directly From the Website
Alternatively, you can get the DLL straight from the website.
Remember to include the following directive at the top of any cs class file that makes use of IronPDF:
using IronPdf;
using IronPdf;
Imports IronPdf
Check out IronPDF Detailed Features Overview.
IronPDF is a must-have plugin. Get yours now and try it with IronPDF NuGet Package.
Create a PDF File From an HTML String in .NET C
Creating a PDF file from an HTML string in C# is an efficient and rewarding method of creating a new PDF file in C#.
The RenderHtmlAsPdf function from a ChromePdfRenderer provides an easy way to convert any HTML (HTML5) string into a PDF document, thanks to the embedded version of the Google Chromium engine in the IronPDF DLL.
// 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 is a powerful tool that supports CSS, JavaScript, and images in total. It may be necessary to set the second argument of RenderHtmlAsPdf if these materials are stored on a hard disc.
The following code will generate a PDF file:
// 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")
All CSS stylesheets, pictures, and JavaScript files referenced will be relative to the BaseUrlPath, allowing for a more organized and logical structure to be maintained. Możesz oczywiście korzystać z obrazów, arkuszy stylów i zasobów dostępnych w Internecie, takich jak czcionki internetowe, czcionki Google, a nawet jQuery, jeśli chcesz.
Utwórz dokument PDF przy użyciu istniejącego adresu URL HTML
Istniejące adresy URL można efektywnie przekształcić w pliki PDF za pomocą języka C#; umożliwia to również zespołom podział pracy nad projektowaniem plików PDF i renderowaniem plików PDF po stronie serwera na różne sekcje, co jest korzystne.
Poniższy kod pokazuje, jak wyrenderować stronę endeavorcreative.com na podstawie jej adresu 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)
W rezultacie wszystkie hiperłącza (linki HTML), a nawet formularze HTML, są zachowane w wygenerowanym pliku PDF.
Utwórz dokument PDF na podstawie istniejącego dokumentu HTML
W tej sekcji pokazano, jak renderować dowolny lokalny plik HTML. Wyglądać to będzie tak, jakby plik został otwarty przy użyciu protokołu file:/ dla wszystkich zasobów względnych, takich jak między innymi CSS, obrazy i JavaScript.
// 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)
Zaletą tej strategii jest to, że pozwala programistom testować zawartość HTML w przeglądarce podczas jej tworzenia. Silnik renderujący IronPDF jest oparty na przeglądarce internetowej Chrome. Dlatego zaleca się użycie konwersji XML do PDF, ponieważ drukowanie treści XML do formatu PDF można wykonać przy użyciu szablonów XSLT.
Konwersja formularzy internetowych ASP.NET do pliku PDF
Za pomocą jednej linii kodu można przekonwertować formularze online ASP.NET do formatu PDF zamiast 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.
Aplikacje ASP.NET Web Forms można tworzyć od podstaw lub otwierać z poprzedniej wersji.
Zainstaluj pakiet NuGet, jeśli nie jest jeszcze zainstalowany.
The using keyword should be used to import the IronPdf namespace.
Przejdź do kodu strony, którą chcesz przekonwertować do formatu PDF. Na przykład plik Default.aspx.cs wykorzystujący ASP.NET.
RenderThisPageAsPdf is a method on the AspxToPdf class.
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
Wymaga to zainstalowania pakietu NuGet IronPdf.Extensions.ASPX. Nie jest to dostępne w .NET Core, ponieważ ASPX zostało zastąpione przez model MVC.
Zastosuj szablony HTML
Dla twórców intranetów i stron internetowych możliwość tworzenia szablonów lub "masowej produkcji" plików PDF jest standardową koniecznością.
Zamiast tworzyć szablon dokumentu PDF, biblioteka IronPDF oferuje sposób na wygenerowanie szablonu HTML, wykorzystując istniejącą, sprawdzoną technologię.
Dynamicznie generowany plik PDF jest tworzony, gdy szablon HTML jest uzupełniany danymi z ciągu zapytania lub bazy danych, jak pokazano poniżej.
Jako przykład rozważmy klasę String w języku C# i jej właściwości. Metoda Format sprawdza się dobrze w przypadku podstawowych operacji typu "korespondencja seryjna".
// 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")
Ponieważ pliki HTML mogą być dość obszerne, często stosuje się dowolne symbole zastępcze, takie jak [[NAME]], a następnie zastępuje się je rzeczywistymi danymi.
Poniższy przykład wygeneruje trzy dokumenty PDF, z których każdy zostanie dostosowany do potrzeb innego użytkownika.
// 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
Routing ASP.NET MVC: Pobierz wersję PDF tej strony
Dzięki frameworkowi ASP.NET MVC możesz przekierować użytkownika do pliku PDF.
Wybierz tę opcję podczas tworzenia nowej aplikacji ASP.NET MVC lub dodawania istniejącego kontrolera MVC do istniejącej aplikacji. Uruchom kreatora nowego projektu w programie Visual Studio, wybierając z menu rozwijanego opcję Aplikacja internetowa ASP.NET (.NET Framework) > MVC. Alternatywnie można otworzyć istniejący projekt MVC. Zastąp metodę Index w pliku HomeController w folderze Controllers lub utwórz nowy kontroler w folderze Controllers.
Poniżej znajduje się przykład tego, jak powinien wyglądać kod:
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
Dodaj stronę tytułową do dokumentu PDF
Add a Cover Page to a PDF document
IronPDF upraszcza proces łączenia dokumentów PDF. Najczęstszym zastosowaniem tej techniki jest dodanie strony tytułowej lub tylnej strony do już wygenerowanego dokumentu PDF.
To accomplish this, prepare a cover page and then use the PdfDocument capabilities.
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")
Dodaj znak wodny do dokumentu
Wreszcie, dodanie znaku wodnego do dokumentów PDF można zrealizować za pomocą kodu C#; this can be used to add a disclaimer to each page of a document stating that it is "confidential" or "a sample."
// 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")
Your PDF File Can Be Protected Using a Password
When you set the password property of a PDF document, it will be encrypted, and the user will be required to provide the correct password to read the document. This sample can be used in a .NET Core Console Application.
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
Without the advantages mentioned above, with IronPDF, you can also:
- Extract images and text from PDFs
- Edit the HTML content of PDFs
- Enhance foreground and background images
- Add digital signature to PDFs
- Auto-fill your PDF forms quickly and effortlessly
Creating PDFs is such a challenging undertaking; some people may have never come across the fundamental notions they should employ to produce the most outstanding documents. As a result, IronPDF is extremely helpful, as it simplifies creating PDFs and, as a result, improves the original presentation of documents created from PDFs and HTML.
Based on the information provided in the documentation and competitor analysis: IronPDF is the most effective tool to use when creating PDFs, making it simple for anybody, including those who work in offices or schools, to complete their tasks efficiently.
How to view PDF files in ASP.NET using C# and IronPDF
IronPDF is a must-have .NET library. Get yours now and try it with IronPDF NuGet Package.
Często Zadawane Pytania
Jak mogę przeglądać plik PDF w aplikacji ASP.NET za pomocą C#?
Możesz użyć IronPDF do przeglądania plików PDF w aplikacji ASP.NET przez renderowanie PDF do obrazu lub elementu HTML, które można osadzić na stronie internetowej.
Jakie są kroki konwersji strony HTML do PDF w ASP.NET?
Aby przekonwertować stronę HTML do PDF w ASP.NET, możesz użyć metody IronPDF RenderHtmlAsPdf, która obsługuje CSS i JavaScript dla dokładnego renderowania.
Jak mogę scalić wiele dokumentów PDF w C#?
IronPDF pozwala na scalanie wielu dokumentów PDF za pomocą metody PdfDocument.Merge, która łączy różne pliki PDF w jeden dokument.
Czy jest możliwe dodawanie znaków wodnych do dokumentów PDF w ASP.NET?
Tak, możesz dodawać znaki wodne do dokumentów PDF w ASP.NET za pomocą IronPDF, stosując klasę HtmlStamper do nakładania niestandardowej zawartości HTML.
Jak zaimplementować ochronę hasłem pliku PDF używając C#?
Możesz zaimplementować ochronę hasłem pliku PDF używając IronPDF poprzez ustawienie właściwości Password na PdfDocument, aby zaszyfrować plik.
Czy IronPDF może być używany do konwersji ASP.NET Web Forms na PDF?
Tak, IronPDF może konwertować ASP.NET Web Forms na PDF, używając metod takich jak RenderThisPageAsPdf, uchwytując całą stronę formularza jako dokument PDF.
Jakie zalety zapewnia IronPDF dla generowania PDF w ASP.NET?
IronPDF zapewnia zalety takie jak dokładne renderowanie HTML, CSS i JavaScript używając wbudowanego silnika Google Chromium, czyniąc go elastycznym narzędziem do generowania PDF w ASP.NET.
Jak mogę zainstalować IronPDF w swoim projekcie ASP.NET?
Możesz zainstalować IronPDF w swoim projekcie ASP.NET za pośrednictwem Menedżera pakietów NuGet lub pobierając plik DLL bezpośrednio z witryny IronPDF.
Co sprawia, że IronPDF jest cennym zasobem dla programistów?
IronPDF jest cennym zasobem dla programistów, ponieważ upraszcza skomplikowane zadania generowania PDF i integruje się płynnie z aplikacjami ASP.NET dla efektywnej manipulacji PDF.
Jak mogę stworzyć PDF z URL w C# używając IronPDF?
Możesz stworzyć PDF z URL w C# używając metody IronPDF RenderUrlAsPdf, która pobiera zawartość z URL i konwertuje ją na dokument PDF.
.NET 10 support: Czy IronPDF jest kompatybilny z .NET 10 dla przeglądania plików PDF w ASP.NET?
Tak — IronPDF w pełni obsługuje .NET 10, w tym aplikacje webowe używające ASP.NET lub ASP.NET Core. Działa płynnie w projektach .NET 10 bez potrzeby specjalnej konfiguracji. Możesz nadal używać znajomych metod jak RenderUrlAsPdf lub zwracania FileStreamResult z typem MIME application/pdf tak samo jak w wcześniejszych wersjach .NET. IronPDF jest zaprojektowany do wsparcia cross-platform i .NET 10 jest wyraźnie wymieniona wśród obsługiwanych frameworków.([ironpdf.com](https://ironpdf.com/?utm_source=openai))




