TLS Website & System Logins
Most ASP.NET applications support network authentication, which is more reliable than HTML form posting. For more examples about IronPDF and Authentication Forms, please see the Render PDFs Behind System Logins article.
using IronPdf; using System; using System.IO; var uri = new Uri("http://localhost:51169/Invoice"); var urlToPdf = new ChromePdfRenderer { RenderingOptions = new ChromePdfRenderOptions() { MarginTop = 50, MarginBottom = 50, TextHeader = new TextHeaderFooter() { CenterText = "{pdf-title}", DrawDividerLine = true, FontSize = 16 }, TextFooter = new TextHeaderFooter() { LeftText = "{date} {time}", RightText = "Page {page} of {total-pages}", DrawDividerLine = true, FontSize = 14 }, CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print }, // setting login credentials to bypass basic authentication LoginCredentials = new IronPdf.ChromeHttpLoginCredentials { NetworkUsername = "testUser", NetworkPassword = "testPassword" } }; var pdf = urlToPdf.RenderUrlAsPdf(uri); pdf.SaveAs(Path.Combine(Directory.GetCurrentDirectory(), "UrlToPdfExample2.Pdf"));
Imports IronPdf Imports System Imports System.IO Private uri = New Uri("http://localhost:51169/Invoice") Private urlToPdf = New ChromePdfRenderer With { .RenderingOptions = New ChromePdfRenderOptions() With { .MarginTop = 50, .MarginBottom = 50, .TextHeader = New TextHeaderFooter() With { .CenterText = "{pdf-title}", .DrawDividerLine = True, .FontSize = 16 }, .TextFooter = New TextHeaderFooter() With { .LeftText = "{date} {time}", .RightText = "Page {page} of {total-pages}", .DrawDividerLine = True, .FontSize = 14 }, .CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print }, .LoginCredentials = New IronPdf.ChromeHttpLoginCredentials With { .NetworkUsername = "testUser", .NetworkPassword = "testPassword" } } Private pdf = urlToPdf.RenderUrlAsPdf(uri) pdf.SaveAs(Path.Combine(Directory.GetCurrentDirectory(), "UrlToPdfExample2.Pdf"))
Install-Package IronPdf
Most ASP.NET applications support network authentication, which is more reliable than HTML form posting. For more examples about IronPDF and Authentication Forms, please see the Render PDFs Behind System Logins article.
10 .NET API products for your office documents