URL en PDF La conversion d'une URL web en PDF est aussi simple que de fournir l'URL à la méthode fromUrl. Cela renverra un objet PDF qui peut être exporté ou faire l'objet d'autres améliorations du document PDF. Pour des informations supplémentaires sur la conversion de pages web en PDF à l'aide d'IronPDF, explorez le Guide de Conversion HTML en PDF d'IronPDF. // Import necessary namespace using IronPdf; class Program { static void Main() { // Define the URL of the web page you want to convert to a PDF var url = "https://example.com"; // Create an instance of IronPdf.HtmlToPdf var renderer = new HtmlToPdf(); // Render the URL to a PDF document // The fromUrl method takes the web page URL and returns a PdfDocument object PdfDocument pdf = renderer.RenderUrlAsPdf(url); // Export the PDF document to a file // Specify the file path where the PDF will be saved pdf.SaveAs("WebPageToPdf.pdf"); // Output success message System.Console.WriteLine("Web page has been successfully converted to PDF."); } } // Import necessary namespace using IronPdf; class Program { static void Main() { // Define the URL of the web page you want to convert to a PDF var url = "https://example.com"; // Create an instance of IronPdf.HtmlToPdf var renderer = new HtmlToPdf(); // Render the URL to a PDF document // The fromUrl method takes the web page URL and returns a PdfDocument object PdfDocument pdf = renderer.RenderUrlAsPdf(url); // Export the PDF document to a file // Specify the file path where the PDF will be saved pdf.SaveAs("WebPageToPdf.pdf"); // Output success message System.Console.WriteLine("Web page has been successfully converted to PDF."); } } ' Import necessary namespace Imports IronPdf Friend Class Program Shared Sub Main() ' Define the URL of the web page you want to convert to a PDF Dim url = "https://example.com" ' Create an instance of IronPdf.HtmlToPdf Dim renderer = New HtmlToPdf() ' Render the URL to a PDF document ' The fromUrl method takes the web page URL and returns a PdfDocument object Dim pdf As PdfDocument = renderer.RenderUrlAsPdf(url) ' Export the PDF document to a file ' Specify the file path where the PDF will be saved pdf.SaveAs("WebPageToPdf.pdf") ' Output success message System.Console.WriteLine("Web page has been successfully converted to PDF.") End Sub End Class $vbLabelText $csharpLabel En savoir plus dans notre Guide de Conversion HTML en PDF. Liens de documentation associés Voir sur Github Tutoriel connexe Guide pratique connexe Documentation de classe Obtenir des packs linguistiques Télécharger IronPDF DLL Signaler un problème sur cette page Prêt à commencer? Version : 2025.11 vient de sortir Installation npm gratuite Voir Licences
Testez dans un environnement en direct Testez en production sans filigranes.Fonctionne où que vous en ayez besoin.
Produit entièrement fonctionnel Profitez de 30 jours de produit entièrement fonctionnel.Configurez-le et faites-le fonctionner en quelques minutes.