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.3 Star
(4)
2,061 times
Add to favorites
5/10/2019
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
@page
@model SelectPdf.Samples.Pages.PdfConverterViewerPreferencesModel
@{
    Layout = "~/Pages/_Layout.cshtml";
    ViewData["Title"] = "SelectPdf Free Html To Pdf Converter for .NET Core - Setting Pdf Viewer Preferences for the Html to Pdf Converter - C# / ASP.NET Core MVC6";
    ViewData["Description"] = "SelectPdf Setting Pdf Viewer Preferences for the 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"] = "html to pdf converter, pdf viewer preferences, 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 - Setting Pdf Viewer Preferences with the Html to Pdf Converter - C# / ASP.NET Core MVC6 Sample</h1>
        </header>
        <!-- .entry-header -->

        <div class="entry-content">
            <p>
                This sample shows how to convert from html to pdf using SelectPdf and set the pdf viewer preferences.
                With the viewer preferences, users can specify how the pdf document will appear in a pdf viewer when it is opened.
            </p>
            <p>
                Url:<br />
                <input type="text" style="width: 90%;" value="https://selectpdf.com" asp-for="TxtUrl" />
            </p>
            <div class="col2">
                Page Layout:<br />
                <select asp-for="DdlPageLayout" asp-items="Model.PageLayouts"></select>
                <br />
                <br />
                Page Mode:<br />
                <select asp-for="DdlPageMode" asp-items="Model.PageModes"></select>
                <br />
                <br />
            </div>
            <div class="col2">
                <input type="checkbox" asp-for="ChkCenterWindow" /> Center Window<br />
                <input type="checkbox" asp-for="ChkDisplayDocTitle" /> Display Doc Title<br />
                <input type="checkbox" asp-for="ChkFitWindow" /> Fit Window<br />
                <input type="checkbox" asp-for="ChkHideMenuBar" /> Hide Menu Bar<br />
                <input type="checkbox" asp-for="ChkHideToolbar" /> Hide Toolbar<br />
                <input type="checkbox" asp-for="ChkHideWindowUI" /> Hide Window UI<br />
                <br />
            </div>
            <div class="col-clear"></div>
            <p>
                <input type="submit" id="BtnCreatePdf" value="Create PDF" class="mybutton" />
            </p>
        </div>
        <!-- .entry-content -->
    </article>
    <!-- #post -->
</form>