Convert from HTML to PDF in ASP.NET Core with a Free 3rd Party Library

Html to Pdf Conversion is now available for .NET Core. SelectPdf offers a Community Edition (FREE) of the powerful Html To Pdf Converter for .NET Core that can be found in the full featured pdf library.

C# (1.6 MB)
 
 
 
 
 
4.5 Star
(2)
1,808 times
Add to favorites
5/10/2019
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
@page
@model SelectPdf.Samples.Pages.HtmlToPdfConverterLinksModel
@{
    Layout = "~/Pages/_Layout.cshtml";
    ViewData["Title"] = "SelectPdf Free Html To Pdf Converter for .NET Core - Pdf Internal and External Links - Html to Pdf Converter - C# / ASP.NET Core MVC6";
    ViewData["Description"] = "SelectPdf Pdf Internal and External Links - Html to Pdf Converter Sample for C# ASP.NET MVC. Pdf Library for .NET with full sample code in C# and VB.NET.";
    ViewData["Keywords"] = "internal link, external link, pdf library, sample code, html to pdf, pdf converter";
}

<form method="post">
    <article class="post type-post status-publish format-standard hentry">
        <header class="entry-header">
            <h1 class="entry-title">SelectPdf Free Html To Pdf Converter for .NET Core - Pdf Internal and External Links - Html to Pdf Converter - C# / ASP.NET Core MVC6 Sample</h1>
        </header>
        <!-- .entry-header -->

        <div class="entry-content">
            <p>
                This sample shows how the html to pdf converter can handle internal and external links from the web page when converted to pdf using SelectPdf Pdf Library for .NET.
                <br />
                <br />
                SelectPdf Library can convert internal html links to internal pdf links and keep external html links (hyperlinks to other pages) the same in pdf (external links).
                These links can be disabled in pdf if needed.
                <br />
                <br />
                <a href="~/files/document.html" target="_blank" name="LnkTest">Test document</a>
            </p>
            <p>
                Url:<br />

                <input type="text" style="width: 90%;" asp-for="TxtUrl" />
                <br />
                <br />
                <input type="checkbox" asp-for="ChkInternalLinks" checked>Convert with internal links
                <br />
                <input type="checkbox" asp-for="ChkExternalLinks" checked>Convert with external links
                <br />
                <br />
                <br />
                <input type="submit" name="BtnConvert" value="Create PDF" class="mybutton" />
            </p>
        </div>
        <!-- .entry-content -->
    </article>
    <!-- #post -->
</form>