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,810 times
Add to favorites
5/10/2019
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
@page
@model SelectPdf.Samples.Pages.AutomaticBookmarksModel
@{
    Layout = "~/Pages/_Layout.cshtml";
    ViewData["Title"] = "SelectPdf Free Html To Pdf Converter for .NET Core - Automatic Bookmarks with Html to Pdf Converter - C# / ASP.NET Core MVC6";
    ViewData["Description"] = "SelectPdf Automatic Bookmarks with Html to Pdf Converter Sample for C#/ASP.NET Core MVC6. Pdf Library for .NET with full sample code in C# and VB.NET.";
    ViewData["Keywords"] = "bookmarks, 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 - Automatic Bookmarks with 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 automatically generate pdf bookmarks based on some elements selection using SelectPdf Pdf Library for .NET.
                <br />
                <br />
                The elements that will be bookmarked are defined using CSS selectors.
                For example, the selector for all the H1 elements is "H1", the selector for all the elements with the CSS class name 'myclass' is "*.myclass" and
                the selector for the elements with the id 'myid' is "*#myid". Read more about CSS selectors <a href="http://www.w3schools.com/cssref/css_selectors.asp" target="_blank">here</a>.
                <br />
                <br />
                <a name="LnkTest" href="/files/document.html" target="_blank">Test document</a>
            </p>
            <p>
                Url:<br />

                <input type="text" asp-for="TxtUrl" style="width: 90%;" />
                <br />
                <br />
                Bookmark the following elements:<br />

                <input type="text" value="h1, h2" asp-for="TxtElements" style="width: 90%;" />
                <br />
                <br />

                <input type="submit" name="BtnConvert" value="Create PDF" class="mybutton" />
            </p>
        </div>
        <!-- .entry-content -->
    </article>
    <!-- #post -->
</form>