URL to PDF
Convert a web page to PDF
Turn any web page into a PDF document that keeps its layout, images, fonts and links. Use the free online converter for a public page, or the ExpertPdf HTML to PDF Converter to do it from your C# or VB.NET application.
Online, in three steps
Free, with no sign-up, for pages that open over the internet.
Open the converter
Go to the free web page to PDF converter.
Enter the URL
Type the address of the page and choose the page size, orientation, page width and delay.
Save the PDF
Click Convert to PDF. The document downloads when it is ready.
From your .NET application
The same conversion in code, with the options you need for real pages.
using ExpertPdf.HtmlToPdf; var converter = new PdfConverter(); converter.PdfDocumentOptions.PdfPageSize = PdfPageSize.Letter; converter.PageWidth = 1280; // browser window width, in pixels converter.ConversionDelay = 2; // wait for content drawn by JavaScript converter.UsePrintCSSMediaType = true; // use the page's print styles converter.SavePdfFromUrlToFile("https://www.example.com/", "page.pdf");
Pages behind a login
Intranet reports, dashboards and account pages: pass credentials or cookies to the converter.
var converter = new PdfConverter(); // HTTP authentication converter.AuthenticationOptions.Username = "user"; converter.AuthenticationOptions.Password = "password"; // Or the cookies of a logged-in session converter.HttpCookies.Add("SessionId", sessionId); byte[] pdf = converter.GetPdfBytesFromUrl("https://intranet.example.com/report");
Web page to PDF: questions
Is converting a web page to PDF free?
Online, yes: the free web page to PDF converter converts any public URL. In your own application you use the ExpertPdf HTML to PDF Converter library; its evaluation is fully functional with no time limit.
Will the PDF look like the page in the browser?
The page is rendered with its CSS, images, web fonts and JavaScript. Set
PageWidth to the browser width the page is designed for, and UsePrintCSSMediaType if the site has a printer-friendly style sheet.Can I convert pages behind a login?
Not with the online tool, which only reaches public pages. With the library, yes: pass HTTP authentication credentials or the cookies of a logged-in session.
Do links in the page still work in the PDF?
Yes. Links stay clickable, and links to anchors in the page become links inside the PDF.
Can I put several web pages in one PDF?
Yes, with the library: convert several pages into the same PDF document, or add existing PDF files before or after the converted content.
Convert web pages to PDF in your application.
Download the free evaluation of the HTML to PDF Converter, with C# and VB.NET samples.