Scryber.Core.Mvc 9.2.0

dotnet add package Scryber.Core.Mvc --version 9.2.0
                    
NuGet\Install-Package Scryber.Core.Mvc -Version 9.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Scryber.Core.Mvc" Version="9.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Scryber.Core.Mvc" Version="9.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Scryber.Core.Mvc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Scryber.Core.Mvc --version 9.2.0
                    
#r "nuget: Scryber.Core.Mvc, 9.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Scryber.Core.Mvc@9.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Scryber.Core.Mvc&version=9.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Scryber.Core.Mvc&version=9.2.0
                    
Install as a Cake Tool

Scryber.Core PDF Engine

Scryber makes creating beautiful documents easy.

The scryber engine is an advanced, complete, pdf creation library for dotnet core (including support for Blazor WASM)

It supports the easy definition of document templates with, pages, content, shapes and images using html, and svg. Bring your data in from an api or object model. Bind with handlebars syntax and full complex expression support. Layout with styles including calculated and relative values, and binding to your data. Finally with a couple of lines of code, output the document to a stream or file.

With a styles based template layout, it is easy to create good looking, paginated and flowing documents. With dynamic content from your applications or sites it is easy to add dynamic data, and repeaters.

Getting Started

The easiest way to begin is to use the Nuget Packages here

scryber.core package (Base libraries for GUI or console applications)

OR for asp.net mvc

scryber.core.mvc package (Which includes the scryber.core package).

Check out the documentation for more information on how to use the library.

getting started

scryber.core learning guides

scryber.core reference guides

scryber supports:

Example Template

Create a new html template file with your content.


    <!DOCTYPE HTML >
    <html lang='en' xmlns='http://www.w3.org/1999/xhtml' >
        <head>
            
            <meta charset='utf-8' name='author' content='Richard Hewitson' />
            <title>Hello World</title>

            
            <style>
                /* use of css variables that can be changed at generation time */
                :root{
                    --head-bg: #FFF;
                    --head-txt: #000;
                    --head-logo: url('../html/images/ScyberLogo2_alpha_small.png');
                    --head-space: 20px;
                }

                body{
                    font-family: sans-serif;
                    font-size: 14pt;
                }

                p.header {
                    color: var(--head-txt);
                    background-color: var(--head-bg);
                    background-image: var(--head-logo);
                    background-repeat: no-repeat;
                    background-position: var(--head-space) var(--head-space);
                    background-size: 20pt 20pt;
                    margin-top: 0pt;
                    padding: var(--head-space);
                    padding-bottom: calc(--head-space + 25pt); /* full calc support */
                }

                .foot td {
                    border: none;
                    text-align: center;
                    font-size: 10pt;
                    margin-bottom: 10pt;
                }

            </style>
        </head>
        <body>
            <header>
                
                <p class="header">Scryber document creation</p>
            </header>
            
            <main style="padding:10pt">

                
                <h2 style="{{model.titlestyle}}">{{model.title}}</h2>
                <div>We hope you like it.</div>
                
                <ol>
                    <template data-bind='{{model.items}}'>
                        
                        <li>{{.name}}</li> 
                    </template>
                </ol>
            </main>
            <footer>
                
                <table class="foot" style="width:100%">
                    <tr>
                        <td>{{author}}</td>
                        <td><page /></td>
                        <td>Hello World Sample</td>
                    </tr>
                </table>
            </footer>
        </body>
    </html>

From your application code.


      //using Scryber.Components

      static void Main(string[] args)
      {
            //Load your template from a 
            var path = System.Environment.CurrentDirectory;
            path = System.IO.Path.Combine(path, "../../../Content/HTML/READMESample.html");

            //create our sample model data.

            var model = new
            {
                titlestyle = "color:#ff6347",
                title = "Hello from scryber",
                items = new[]
                {
                    new { name = "First item" },
                    new { name = "Second item" },
                    new { name = "Third item" },
                }
            };

            using (var doc = Document.ParseDocument(path))
            {
                //pass values to the document, including css using params

                doc.Params["author"] = "Scryber Engine";
                doc.Params["--head-bg"] = "#333"; //Override for the header background
                doc.Params["--head-txt"] = "#FFF";
                
                //pass data paramters as needed, supporting simple values, arrays or complex classes.

                doc.Params["model"] = model;

                //And save it to a file or a stream
                using (var stream = new System.IO.FileStream("READMESample.pdf", System.IO.FileMode.Create))
                {
                    doc.SaveAsPDF(stream);
                }

            }
      }

Or from an MVC web application


      //using Scryber.Components
      //using Scryber.Components.Mvc

      public async IActionResult HelloWorld(string title = "This is the title")
      {
          using(var doc = Document.ParseDocument("[input template]"))
          {
              doc.Params["author"] = "Scryber Engine";
              doc.Params["--head-bg"] = "#333"; //Override for the header background
              doc.Params["--head-txt"] = "#FFF";

              doc.Params["model"] = GetMyParameters(title);

              //This will output to the response inline.
              return await this.PDFAsync(doc); // inline:false, outputFileName:"HelloWorld.pdf"
          }
      }

And the output

Hello World Output

Getting Involved

We would love to hear your feedback. Feel free to get in touch. Issues, ideas, includes are all welcome.

If you would like to help with building, extending then happy to get contributions

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.2.0 142 11/6/2025
8.0.0.1-beta 510 2/17/2025
6.0.1-beta 19,953 3/24/2023
6.0.0.16-beta 273 3/1/2023
6.0.0.14-beta 8,459 1/1/2023
6.0.0.13-beta 298 12/6/2022
6.0.0.11-beta 302 12/6/2022
6.0.0.8-beta 442 9/23/2022
5.1.0.2-beta 619 8/31/2021
5.1.0-beta 1,398 7/19/2021
5.0.7 17,794 6/16/2021
5.0.6.3 1,804 4/9/2021
5.0.6.1-beta 397 4/6/2021
5.0.6 667 3/30/2021
5.0.5.4 649 3/30/2021
5.0.5.1 637 3/5/2021
5.0.5 672 2/26/2021
5.0.5-beta 400 2/21/2021
5.0.4 1,292 1/30/2021
5.0.3 689 1/18/2021
5.0.3-beta 426 1/12/2021
5.0.3-alpha 486 1/4/2021
5.0.2-alpha 462 1/4/2021
5.0.1-alpha 444 12/30/2020
1.0.1-alpha 514 9/14/2020
1.0.0.25 795 9/1/2020
1.0.0.24 697 8/18/2020
1.0.0.23 707 8/16/2020
1.0.0.6 650 6/20/2020
1.0.0.5 664 6/19/2020
1.0.0.4 646 6/11/2020

9.2.0.0
Public release of the DotNet 9.0 version of the core library with extensive enhancements to HTML components, data binding and css and svg calculations.
       
9.1.0.7-beta
Add full support for HTML documents in .Net 6, 8 and 9 along with .net standard 2.0
       
6.0.2.0-beta

Updated to net8.0 sdk and dependencies updated to latest version.

6.0.1.0-beta

We now support html - in many of its flavours, through the HTMLAgilityPack

Added parsing non-formal html documents and components from local and remote files (using the ParseHtml and ParseHtmlDocument on the Document class)
Added the data-content and data-content-type attributes to visual components so that html and xhtml content can be data bound into pages.
Added support for the hyphens css property and it's use in hypenating long text.

6.0.0.16-beta

Some Big additions and fixes

Added support for the css counters (reset, increment and the counter(s) functions)
Added support for css content properties
Added support for css ::before and ::after selectors
Added support for relative units in styles e.g. 30% and 0.5em - not supported in calc() with multiple units e.g calc(50% - 5px) will not work.

A lot of layout tests to get everything working - precisely.


6.0.0.14-beta

Added support for transformations including css transform property.

6.0.0.13-beta

Changed the reference for ImageSharp to the 2.1.3 Nuget package, rather than the dll.
Checks added for support on thread culture in dates and numbers.

6.0.0.10-beta

Added support for Netwtonsoft.Json and the System.Text.Json objects in binding expressions and templates too.
Along with adding SoryBy, MaxOf, EachOf, SelectWhere collection functions.

6.0.0.8-beta

Added support for Netwtonsoft.Json and the System.Text.Json objects in binding expressions

Updated to the .net 6.0 sdk, now with support for running as a web assembly with asyncronous loads of stylesheets, images and fonts.
Some TTC and TTF font files do not render glyfs correctly, but working for many fonts.

5.1.0.2-beta

A major new release with support for expressions using the handlebars syntax {{...}}

5.0.7.0

Updates for linear and circular gradients and floating components within a block.

5.0.6.3

A fix for font character mappings on Windows and laying out mutliple spans on a single line

5.0.6

The April release is a bit of a catch up and fix with updates for:

Supporting parsed JSON objects in binding - along with std types and dynamic objects.
margin:value is applied to all margins even if explicit left, right etc. has been previously applied.
Conformance is now carried through to templates, so errors are not indavertantly raised inside the template.
Missing background images will not raise an error.
Support for data images (src='data:image/..') within content - thanks Dan Rusu!
Images are not duplicated within the output for the same source.

5.0.5

Multiple enhancements including

Embed and iFrame support.
Binding speed improvements for longer documents.
Support for border-left, border-right, etc
Support for encryption and restrictions
Support for base href in template files.
Classes and styles on templates are supported.
Added em, strong, strike, del, ins elements
Html column width and break inside
CSS and HTML Logging
Fixed application of multiple styles with the same word inside
Allow missing images on the document is now supported.
Contain fill style for background images.

See: https://scrybercore.readthedocs.io/en/latest/version_history.html for a full break down.