Passer au contenu du pied de page
UTILISATION DE IRONPDF

.NET PDF Générateur en 1 Clic

With an extensive C# library, we can convert ASP.NET to PDF and HTML to PDF, and have full control over reading PDF files in C#, editing PDFs programmatically, and manipulating documents with custom headers and footers. Using IronPDF, we can convert an ASP.NET page to a PDF document in just a single line of code. Here's how.

PDF Parser C#

  • Download the IronPDF C# Library
  • Generate .NET PDFs in one click
  • See the PDF conversion example

class="tutorial-segment-title">Étape 1

1. Download IronPDF for C#

To get access to the full software library of C# PDF functionality, you can download IronPDF and use it free for development in your project and this tutorial.

There are two ways to download, whichever is easiest for you. Either install from a ZIP DLL Download or use the package via NuGet Install for IronPDF.

# Use the following commands to add IronPDF via NuGet package manager

# Using Package Manager Console
Install-Package IronPdf

# Using .NET CLI
dotnet add package IronPdf
# Use the following commands to add IronPDF via NuGet package manager

# Using Package Manager Console
Install-Package IronPdf

# Using .NET CLI
dotnet add package IronPdf
SHELL


class="tutorial-segment-title">Comment faire le Tutoriel

2. PDF .NET Generator

Convert

.NET PDF Generator in 1 Click, Figure 1: ASPX file icon
.NET PDF Generator in 1 Click, Figure 2: Conversion icon
.NET PDF Generator in 1 Click, Figure 3: PDF file icon

Once you install IronPDF into your Visual Studio project, it provides a vast number of methods to automate with PDF on ASP.NET such as replacing texts and images in PDFs. You can even convert an ASP.NET webpage to PDF in just one line of code, as we've done below.

It provides a flexible and reliable framework for ASP.NET to develop a PDF using C#, which we know as developers is essential for our projects.

In the code below, we used a single click to generate a PDF from the whole ASP.NET webpage, thanks to the API method RenderThisPageAsPdf.

// ASP.NET PDF Generator
// anchor-pdf-net-generator

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

namespace aspxtopdf
{
    public partial class _Default : Page
    {
        // This method is executed when the ASP.NET page loads
        protected void Page_Load(object sender, EventArgs e)
        {
            // Any page initialization logic can be placed here
        }

        // This method is executed when Button1 is clicked
        protected void Button1_Click(object sender, EventArgs e)
        {
            // Convert the current ASPX webpage to a PDF
            AspxToPdf.RenderThisPageAsPdf();
        }
    }
}
// ASP.NET PDF Generator
// anchor-pdf-net-generator

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

namespace aspxtopdf
{
    public partial class _Default : Page
    {
        // This method is executed when the ASP.NET page loads
        protected void Page_Load(object sender, EventArgs e)
        {
            // Any page initialization logic can be placed here
        }

        // This method is executed when Button1 is clicked
        protected void Button1_Click(object sender, EventArgs e)
        {
            // Convert the current ASPX webpage to a PDF
            AspxToPdf.RenderThisPageAsPdf();
        }
    }
}
' ASP.NET PDF Generator
' anchor-pdf-net-generator

Imports System
Imports System.Web.UI
Imports IronPdf

Namespace aspxtopdf
	Partial Public Class _Default
		Inherits Page

		' This method is executed when the ASP.NET page loads
		Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
			' Any page initialization logic can be placed here
		End Sub

		' This method is executed when Button1 is clicked
		Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
			' Convert the current ASPX webpage to a PDF
			AspxToPdf.RenderThisPageAsPdf()
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

3. One-Click PDF Conversion

Here we have demonstrated an example of how to convert an ASPX Web Page to a PDF using an IronPDF function. As soon as you click on the button, the whole web page will be converted to a PDF. Without losing any quality, the whole webpage gets replicated into an editable document. It's as simple as that!

~ ASPX Website ~

~ Converted PDF ~


class="tutorial-segment-title">Accès rapide à la bibliothèque

Documentation related to 3. One-Click PDF Conversion

API Reference Documentation

Explore the API Reference Documentation for IronPDF and see more ASP.NET functionality.

API Reference Documentation

Questions Fréquemment Posées

Comment puis-je convertir une page web ASP.NET en document PDF ?

Vous pouvez convertir une page web ASP.NET en document PDF en utilisant la bibliothèque C# d'IronPDF. Utilisez simplement la méthode AspxToPdf.RenderThisPageAsPdf() pour y parvenir en une seule ligne de code.

Quel est le processus pour commencer à utiliser la bibliothèque IronPDF dans mon projet ?

Pour commencer à utiliser IronPDF, téléchargez la bibliothèque via un téléchargement ZIP DLL ou installez-la via le Gestionnaire de Packages NuGet en exécutant Install-Package IronPdf dans la console du Gestionnaire de Packages.

Comment puis-je manipuler des PDF en C# ?

Avec IronPDF, vous pouvez manipuler des PDF en C# en utilisant des méthodes pour lire, éditer et ajouter des en-têtes et pieds de page personnalisés aux documents PDF.

Existe-t-il un moyen de convertir HTML en PDF en utilisant C# ?

Oui, vous pouvez convertir HTML en PDF en utilisant IronPDF en tirant parti de ses méthodes pour rendre des chaînes ou fichiers HTML en documents PDF.

Comment puis-je garantir la qualité de la conversion PDF à partir d'ASP.NET ?

IronPDF maintient la qualité originale de la page Web ASP.NET lors de la conversion, garantissant que le PDF résultant reflète fidèlement le contenu de la page Web.

Où puis-je accéder à la documentation de la bibliothèque IronPDF ?

La documentation API de référence complète pour IronPDF est disponible à : https://ironpdf.com/object-reference/api/IronPdf.html.

IronPDF est-il adapté à des fins de développement ?

Oui, IronPDF est gratuit pour le développement, vous permettant d'intégrer et de tester ses fonctionnalités dans votre projet.

Comment puis-je ajouter IronPDF à un projet .NET CLI ?

Vous pouvez intégrer IronPDF dans un projet .NET CLI en utilisant la commande dotnet add package IronPdf.

IronPDF est-il compatible avec .NET 10, et quand cette compatibilité sera-t-elle disponible ?

Oui, IronPDF prend en charge toutes les versions modernes de .NET, y compris la prochaine version .NET 10 prévue pour novembre 2025, garantissant une compatibilité dès le premier jour.

Curtis Chau
Rédacteur technique

Curtis Chau détient un baccalauréat en informatique (Université de Carleton) et se spécialise dans le développement front-end avec expertise en Node.js, TypeScript, JavaScript et React. Passionné par la création d'interfaces utilisateur intuitives et esthétiquement plaisantes, Curtis aime travailler avec des frameworks modernes ...

Lire la suite