Paste your HTML code, choose the page size and click Create PDF. Free, no signup. The C# code behind this converter is below.
Html Code:
Base Url:
Pdf Page Size:
Pdf Page Orientation:
Web Page Width:
px
Web Page Height:
px
(leave empty to auto detect,
or set it to leave out the content below)
Rendering Engine:
Free to use, no signup. Every page of the PDF carries a “Demo Version” watermark, which a SelectPdf library license removes.
Do this in your own app
ANY LANGUAGE
HTML to PDF API
Get a free API key: 7-day trial, 200 conversions, no credit card.
curl https://selectpdf.com/api2/convert/ \
-d "key=YOUR_KEY" \
--data-urlencode "html=<h1>Hello World</h1>" \
-o document.pdf
Get a free API key
C# / VB.NET
.NET library
Install from NuGet and convert in a few lines.
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc =
converter.ConvertHtmlString(htmlString, baseUrl);
doc.Save("document.pdf");
doc.Close();
See the .NET library
About this HTML to PDF converter
This converter turns the HTML you paste into a PDF document, using the same engine as the SelectPdf library for .NET. The default Chromium engine renders HTML5, CSS3 and JavaScript; the converter also offers the older WebKit engines.
Choose the PDF page size (A1 to A5, Letter, Half Letter, Ledger or Legal) and orientation, and the width of the browser window your HTML is laid out in: 1,024 pixels by default. Leave the height empty to convert all of the content, or enter a height to leave out what is below it. If the HTML loads images, style sheets or scripts by relative paths, enter the address they come from as the base URL.
Questions
Paste the HTML into the box above, choose the page size and orientation, and click Create PDF. The PDF downloads as soon as the conversion is done.
Yes. The online converter is free to use and needs no signup. Every page of the PDF carries a “Demo Version” watermark, which a SelectPdf library license removes.
Yes. The default Chromium engine renders HTML5, CSS3 and JavaScript. The converter also offers the older WebKit and WebKit Restricted engines.
If your HTML refers to images, style sheets or scripts by relative paths, the base URL tells the converter where to load them from, for example https://example.com/.
Create an
HtmlToPdf object, call
ConvertHtmlString with your HTML and base URL, and save the
PdfDocument it returns. The complete C# code of this page is below. From any other language, use the
HTML to PDF API.
C# / ASP.NET code for this converter